4
One of them occurs when I wish to order a array number.
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 array well small, but what I am working on(with more than 300 occurrences) has happened the same. 115 appears before 2, for example.
There are several websites where you can find tutorials and practical examples of Javascript. For the ordering case you can see here: http://www.w3schools.com/jsref/jsref_sort.asp
– Edu