News for hackers. Stuff that matters.
Re:The Curious Case of JavaScript’s `sort` by xlm1717 on Wednesday April 13, 2016 @11:20AM (#11488915)
It might have made more sense to not have default behavior and force the user to specify how they want to sort. They could also have done what PHP did and provided several different .sort functions depending on how you want to sort.
Re:The Curious Case of JavaScript’s `sort` by fenomas on Wednesday April 13, 2016 @11:33AM (#11489045)
I think ECMA4 proposed behavior flags, so you could do:

    arr1.sort( Array.NUMERICAL | Array.DESCENDING )
    arr2.sort( Array.CASE_INSENSITIVE )
or similar.