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

Parameter

Type

Description

collection

Iterable<T>

comparer

(x: any, y: any) => number

(Optional)

Returns:

boolean