Copy to ClipboardRawPreviewconst minN = (arr: Array<number>, n: number = 1) => [...arr].sort((a, b) => a - b).slice(0, n); Min elements array00gioyikCodiga's TypeScript RecipesReturns the n minimum elements from the provided array.0 CommentsAdd CommentLog in to add a comment