3 ms·
So it uses lexicographic sort by default, just pass a custom comparator no? https://gist.github.com/4471254 https://gist.github.com/4471254
by shimms 14y ago
So it uses lexicographic sort by default, just pass a custom comparator no?
https://gist.github.com/4471254 https://gist.github.com/4471254
- md224 14y agoor if he doesn't even feel like passing a custom comparator every time and just wants to default to increasing numerical order: (function(){var a=function(a,b){return a>b},b=Array.prototype.sort;Array.prototype.sort=function(){return b.call(this,a)}})();
- hcarvalhoalves 14y agoI'm aware of the solution. What I'm disputing is why sort does the least obvious, stupidest thing I can think about by default - specially since numerical is equivalent to alphabetical for the ASCII set.