The Array.sort() Bug Only Numbers Above 9 Trigger
Array.sort() with no compare function sorted [11, 22, 110] as [11, 110, 22] in my test A 20-item array of multiples of 11 came back with 9 of them out of numeric order A random 10,000-number array had 89 adjacent pairs still out of order after the default sort One compare function, (a, b) => a - b,…
Read the full story at DEV Community — AI ↗
Timeline · 1 report
- 2026-11-05 22:47 · DEV Community — AI
The Array.sort() Bug Only Numbers Above 9 Trigger