Creates a Comparator that compares the elements of two Arrays pairwise.
Finds the first unequal pair and returns the result.
If all pairs are equal the Array's length will be used for comparison.
length
Compare two Arrays of numbers
const numberArrayComparator = arrayComparator(numberComparator);const result = numberArrayComparator([1, 1], [2]);console.log(result); // 1
a Comparator for Arrays of type T
T
the Comparator value type
the Comparator to use for the elements
Generated using TypeDoc
Creates a Comparator that compares the elements of two Arrays pairwise.
Finds the first unequal pair and returns the result.
If all pairs are equal the Array's
lengthwill be used for comparison.Example
Compare two Arrays of numbers
Returns
a Comparator for Arrays of type
T