sort

Bun

Symbol

Uint8Array.sort

sort(compareFn?: (a: number, b: number) => number): this

Sorts an array.

@param compareFn

Function used to determine the order of the elements. It is expected to return a negative value if first argument is less than second argument, zero if they're equal and a positive value otherwise. If omitted, the elements are sorted in ascending order.

[11,2,22,1].sort((a, b) => a - b)