compare numbers A and B and tell if A is greater, lower or equal to B by returning 1, 0, -1. Works with array.sort()