News for hackers. Stuff that matters.
Re:Blessed Are the JavaScript Developers by naikrovek on Monday August 31, 2020 @06:21PM (#24336487)
> I'm not sure it's unexpected.

What do YOU expect when you ask someone to sort items that are clearly numbers?

I don't know about you, but I do not expect what actually happened.

Re:Blessed Are the JavaScript Developers by danShumway on Monday August 31, 2020 @07:20PM (#24336887)
We don't know that the items are clearly numbers, arrays in Javascript are untyped.

Your proposal is that Javascript's default sort algorithm should change behaviors based on whether it can do an extra O(n) loop over the entire array and check whether `typeof x === 'number'` evaluates to true for each index? I don't think that's a good idea.