Why does Array.from accept non-iterable arraylikes?

Jason Orendorff jason.orendorff at gmail.com
Tue Jun 25 08:58:49 PDT 2013


On Tue, Jun 25, 2013 at 10:42 AM, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:
>> I think TC39 made @@iterator a symbol on the theory that users would
>> want to build iterable Proxy-based string-key maps that would support
>> property-access syntax.
>
> My recollection is that we chose to make `iterator` a symbol because
> we worried about taking the name "iterator" on lots of existing
> objects.

What kind of existing code would be a problem?

Firefox added Array.prototype.iterator a year ago. It has shipped in
the release browser, and it's been fine.

-j


More information about the es-discuss mailing list