Suggestions for Set

Jason Orendorff jason.orendorff at gmail.com
Wed Oct 3 11:38:40 PDT 2012


On Wed, Oct 3, 2012 at 11:34 AM, Brendan Eich <brendan at mozilla.com> wrote:
>> * the spread syntax just uses the iteration protocol;
>
> This differs from Array.from -- any reason not to fall back on the
> array-like protocol (which for missing 'length' iterates no values)?

I think ES6 should have a single how-to-iterate behavior shared by
Array.from, spread syntax, and for-of.

Whether that includes a fallback to .length or not seems less important to me.

It seems simpler *not* to include the fallback. Firefox doesn't
include it at present. Instead, arraylike objects are pretty much all
iterable. That wasn't hard to do, since our Array.prototype.iterator
is generic.

-j


More information about the es-discuss mailing list