Allen Wirfs-Brock wrote:
Did we talk about the implications of of using iterable protocol if the array
has holes?

We did, and some of us agreed that a.forEach skips holes, so for (v of a) should too.

But you are right, that means spread can't sensibly use iteration.

On the other hand, drafted and prototyped iteration on arrays does not currently skip holes. It fills them in argument list and enclosing array literals. In the latter it could preserve holes rather than filling them with undefined values, but in argument lists there's no such thing as a hole.

Which is more important, iterating over holes (preserved if possible), or skipping them and therefore spreading array-likes but not iterables?

/be
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to