2 ms·
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 beh
by danShumway 6y ago
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.