first value to compare
second value to compare
The difference between the two numbers
This function subtracts the second number from the first number and returns the result.
const arr = [3, 1, 4, 1, 5]
arr.sort(compareNumber) // [1, 1, 3, 4, 5]
Generated using TypeDoc
Number comparator function (ascending)