(no title)
inbx0 | 6 months ago
The default object property iteration rules in JS define that numeric properties are traversed first in their numeric order, and only then others in the order they were added to the object. Since the numbers need to be in their numeric, not lexical, order, the engine would also need to parse them to ints before sorting.
> JSON.stringify({b: null, 10: null, 1: null, a: null})
'{"1":null,"10":null,"b":null,"a":null}'
No comments yet.