Comment on HTML5WowparentComments−shimms13ySo it uses lexicographic sort by default, just pass a custom comparator no?https://gist.github.com/4471254−md22413yor 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)}})();−hcarvalhoalves13yI'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.
Comments
So it uses lexicographic sort by default, just pass a custom comparator no?
https://gist.github.com/4471254
or 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)}})();
I'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.