first value to compare
second value to compare
A number indicating the sort order. -1 if a
is greater than b
, 1 if a
is less than b
, 0 if they are equal.
This function is used for sorting arrays of numbers in descending order.
const arr = [true, 3n, -2n, false]
arr.sort(compareNumericDescending) // [3n, true, false, -2n]
Generated using TypeDoc
number, bigint, boolean comparator function (descending)