Sort numbers in ascending order.
[10, 4, 5, 0].sort(numericComparer);// Yields: [0, 4, 5, 10][10, 4, 5, 0].sort(comparerInverse(numericComparer));// Yields: [ 10, 5, 4, 0] Copy
[10, 4, 5, 0].sort(numericComparer);// Yields: [0, 4, 5, 10][10, 4, 5, 0].sort(comparerInverse(numericComparer));// Yields: [ 10, 5, 4, 0]
Returns: 0: values are equal negative: a should be before b positive: a should come after b
a
b
Sort numbers in ascending order.
Returns: 0: values are equal negative:
ashould be beforebpositive:ashould come afterb