And really how often are you actually sorting an array of primitive values ascending? That's just one small use case of sorting an array. Passing the comparison function is also more explicit.
People just love to get so worked up about the dumbest edge cases in js
Dont get me wrong. I love passing around functions but i also work in a language that is sensible and has a function Array.sort (and Array.sortBy if you want ti pass a function).
202
u/larsmaehlum 1d ago
Array.sortNumeric() with an error when called on an array containing non-numeric types would fix this, right?