Compares the values a and b by their natural reversed order via the > operator. Returns 0 if the values are strictly equal.
a
b
>
0
// descending[0, 3, 5, 1, 2, 4].sort(reversedOrder) == [5, 4, 3, 2, 1, 0];reversedOrder(-1, 1) === 1;reversedOrder("AA", "B") === 1; // alphabetical for stringsreversedOrder("A", "a") === 1; // alphabetical for stringsreversedOrder(0, 0) === 0;reversedOrder(0, "0") === 1;
first value
second value
Generated using TypeDoc
Compares the values
a
andb
by their natural reversed order via the>
operator. Returns0
if the values are strictly equal.Example