Why does Array.from accept non-iterable arraylikes?

Anne van Kesteren annevk at annevk.nl
Tue Jun 25 10:19:41 PDT 2013


On Tue, Jun 25, 2013 at 4:58 PM, Jason Orendorff
<jason.orendorff at gmail.com> wrote:
> On Tue, Jun 25, 2013 at 10:42 AM, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:
>> 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.

E.g. HTMLCollection has named getters. Making it iterable without
breaking compatibility would be great.


--
http://annevankesteren.nl/


More information about the es-discuss mailing list