Sort numbers in Javascript array
Dec 05
Javascript Array, Javascript, numeric array, Sort, Sort numbers, sort numeric arrays 4 Comments

Sorting an array in Javascript is a snap.
You create an array and then call sort() method on that array. The Javascript sort() method sorts an array in lexicographical order. This method is very useful in sorting alphanumeric values of an array.
Here is an example
var ages = new Array (23,6,2,16,48,9,6);
ages.sort();
The array will become (16,2,23,48,6,6,9)
Fortunately, the work around for this problem is quite simple.
More


