Function
| Static Public Summary | ||
| public |
Outputs an array containing the elements of the input iterable sorted according to a given comparison function. |
|
Static Public
public sorted(compare: Function, iterable: Iterable): Array source
import sorted from '@iterable-iterator/sorted/src/sorted.js'Outputs an array containing the elements of the input iterable sorted according to a given comparison function.
Params:
| Name | Type | Attribute | Description |
| compare | Function | The comparison function to use. This function must be 2-ary. It must return -1, 0, or 1 depending whether the first parameter is, respectively, less than, equal to, or greater than the second parameter. |
|
| iterable | Iterable | The input iterable. |
