3 ms·
JavaScript `array.sort()` doesn't work with negative numbers
- ksherlock 3y agovia MDN: "The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values." [1, 99, 100] would also sort non-numerically, no negatives necessary.
- behnamoh 3y agoThis is insane!
- bencelaszlo 3y agoWhat is so insane about the alphabetical order?