How to sort an array numerically in JavaScript
The default ECMAScript sort is alphabetical, so a little magic is needed to sort an array in numerical order.
Ever try to sort an array of integers in JavaScript using .sort()
and get a weird result, where the order was not numeric?