I have got a very strange result trying to sort an array:
[0,1,2,3,4,5,6,7,8,9,10].sort(function(a,b) {return a > b;})
Result:
[5, 0, 1, 2, 3, 4, 6, 7, 8, 9, 10]
I would like to understand, why is this result return? I know, that sort function should be written like this:
[0,1,2,3,4,5,6,7,8,9,10].sort(function(a,b) {return a - b;})