Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/node-core-library > Sort > isSorted

Sort.isSorted() method

Returns true if the collection is already sorted.

Signature:

static isSorted<T>(collection: Iterable<T>, comparer?: (x: any, y: any) => number): boolean;

Parameters

ParameterTypeDescription
collectionIterable<T>
comparer(x: any, y: any) => number(Optional)

Returns:

boolean