Home Manual Reference Source

Function

Static Public Summary
public

sorted(compare: Function, iterable: Iterable): Array

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

Outputs an array containing the elements of the input iterable sorted according to a given comparison function.

Params:

NameTypeAttributeDescription
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.

Return:

Array

The input iterable, sorted.