Quote:

If compareFunction(a, b) is less than 0, sort a to a lower index than b.

If compareFunction(a, b) returns 0, leave a and b unchanged with respect to each other, but sorted with respect to all different elements.

If compareFunction(a, b) is greater than 0, sort b to a lower index than a.

Quote:

If compareFunction(a, b)is less than zero, sort b to a lower index than a.

If compareFunction(a, b)returns zero, leave a and b unchanged relative to

each other.

If compareFunction(a, b)is greater than zero, sort b to a higher index than a.