iteration order for Object
Boris Zbarsky
bzbarsky at MIT.EDU
Thu Mar 10 18:35:36 PST 2011
On 3/10/11 9:18 PM, Charles Kendrick wrote:
> Boris, this is why I also took care to mention that for..in iteration on
> Arrays should remain unordered
What does this have to do with the post you're replying to?
> so that developers doing relatively obscure things like crypto evoting in JavaScript (the use case in the
> first bug) still have access to a dense-array implementation.
The point is that the bignum library there is using vanilla objects, not
arrays. And they're using numeric property names.
> If Array for..in iteration continues to be unordered, any developer that
> cares about the tiny
> performance difference can use an Array to store non-numeric
> property/value pairs.
1) They're not doing that now, necessarily, and there's no indication
that they'll start.
2) A factor of 6 is not a "tiny performance difference".
-Boris
More information about the es-discuss
mailing list