Array iterator questions

Jason Orendorff jason.orendorff at
Sat Dec 1 08:14:31 PST 2012

1. The current draft spec has Array.prototype.@@iterator() behaving like
.values(), so:

    for (x of ["a"])

would print the pair ["0", "a"].

The proposal had Array iterators producing values only by default. Why the

(It seems like it could be a typo, or it could be motivated by a desire for
consistency across all collections. If the latter, Map should change, not

2. According to, the iterators produced by Array.prototype.keys
and .items will expose the index values as strings. Why strings? Don't
numbers make more sense?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list