One of these occurs when I want to sort an array of numbers.
Ex:
var a = [44,7,5,6,4,2,1];
a.sort();
console.log(a);
The expected result would be:
[1, 2, 4, 5, 6, 7, 44], but what is always returned to me is [1, 2, 4, 44, 5, 6, 7]....
asked by
16.03.2016 / 15:36