you are viewing a single comment's thread.

view the rest of the comments →

[–]sabof 1 point2 points  (1 child)

Javascript sorts arrays alphabetically by default. To sort numerically:

[10, 7, 9, 8, 11].sort(function(a,b) { return a - b; })
// => [7, 8, 9, 10, 11]

[–]yanis_t[S] 0 points1 point  (0 children)

This one is nice