4 ms·
In the ECMAScript language spec, at least as far back as 1999, it quite specifically does say "unordered".
by bshimmin 13y ago
In the ECMAScript language spec, at least as far back as 1999, it quite specifically does say "unordered".
- magicalist 13y agoyes, but kevingadd was (almost certainly) talking about in practice. In fact, I vaguely recall reading that the V8 team originally wanted to abandon insertion-order enumeration for performance but couldn't because too much code broke on the web. It's not quite insertion order, though, which is one of the issues with just specifying it in ES6 as it's implemented. If you insert with a numeric key (or a string that's strictly a number), I believe the JS engines don't agree on the order in which the numeric key will be enumerated in relation to the alphanumeric ones (v8 and spidermonkey will put the numeric ones ahead of all the keys, sorted ascending, then do the rest in insertion order, for instance).