Sorts the elements (using the given sort function if provided). Beware: all elements need to fit in memory before they can be sorted!
pipe( itr8FromArray([ 1, -2, 7, 4 ]), sort(), // => [ -2, 1, 4, 7 ] );
pipe( itr8.itr8FromArrayAsync([ { v: 1 }, { v: -4 }, { v: 7 }, { v: 2 } ]), itr8.sort((a:{ v:number }, b:{ v:number }, => a.v - b.v)) );
Optional
Generated using TypeDoc
Sorts the elements (using the given sort function if provided). Beware: all elements need to fit in memory before they can be sorted!
Example
Example