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].
This is a very small array , but the one I'm working on (with over 300 occurrences) has been the same. 115 appears before 2, for example.