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

Sort.isSorted() method

Returns true if the array is already sorted.

Signature:

static isSorted<T>(array: T[], comparer?: (x: any, y: any) => number): boolean;

Parameters

Parameter Type Description
array T[]  
comparer (x: any, y: any) => number  

Returns:

boolean