2 ms·
It's probably to get around the non-deterministic ordering of objects. New Map({'a': 'bar', '1': 'foo'}); Would flip the order of the keys.
by underwater 12y ago
It's probably to get around the non-deterministic ordering of objects.
New Map({'a': 'bar', '1': 'foo'});
Would flip the order of the keys.
- bryanlarsen 12y agoTo be pedantic, in all modern browsers the order is deterministic. But it certainly can be surprising. For those who aren't aware, browser Javascript maintains insertion order, except for numeric keys, which are in numeric order ahead of all other keys.
- johnhenry 12y agoDo you have a source on this by chance?