core3-utils

@wixc3/common on Github

Home > @wixc3/common > sort

sort() function

Signature:

export declare function sort<T>(iterable: Nullable<Iterable<T>>, by?: (a: T, b: T) => number): Iterable<T>;

Parameters

Parameter Type Description
iterable [Nullable](/core3-utils/common.nullable.html)<Iterable<T>>
by (a: T, b: T) => number _(Optional)_ comparator, returns a negative value if a should precede b

Returns:

Iterable<T>