Re:JavaScript Is Weird
by mherrmann on Monday June 28, 2021 @08:27AM
(#27660963)
JavaScript sorting numbers alphabetically is a fact I simply cannot get over. I know I should be pragmatic as an engineer but this goes against the core of my being. Awful.
[ Parent
| on HN ]
Since it’s (imo) default-wrong in English, I’ve chosen to think of it as a nice way to point devs to something that’s locale-aware like Intl.Collator instead. If it “just worked” in English, most of us would never think to use the correct utility instead.
This is a bit of a tangent, but that makes me wonder… are there any languages where this particular collation would be correct?