Suggestions for Set

Brendan Eich brendan at mozilla.org
Tue Oct 2 15:57:45 PDT 2012


Brendan Eich wrote:
>> I would imagine arrays, NodeLists, arguments, and other array-likes 
>> all respond to for-of; if they don't, that seriously decreases the 
>> utility of for-of!
>
> Array.from is

s/is/tests/

> that an object is either iterable, or failing that, array-like (even 
> if no .length property, ToUint32(undefined) => 0 so no elements). See 
> bottom of 
> https://mail.mozilla.org/pipermail/es-discuss/2012-July/024207.html.

As for the list of built-ins after arrays, specifically "NodeLists, 
arguments, ..." I agree these should all be iterable.

/be


More information about the es-discuss mailing list