The ES6 iterator/iterable story has been criticised more than once, by a number of people. Too lazy to dig up all those threads, but if you search es-discuss for iterable and iterator you will find it a reoccurring scheme. AFAIK, this thread contained the first such discussion: https://mail.mozilla.org/pipermail/es-discuss/2013-March/029004.html
The short story from my POV is: the notion of iterators vs. iterables in ES6 makes no coherent sense, but many people want their implicit conversions despite any smell, and this basically provides (a user-definable) one from anything to an iterator. On 26 July 2016 at 04:16, Allen Wirfs-Brock <[email protected]> wrote: > > > On Jul 25, 2016, at 4:38 PM, John Lenz <[email protected]> wrote: > > > > Yes, but at the cost of being able to reason / declare what kind of > object is actually required. But, I'm sure there is nothing that can be > changed here. > > The kind of object that is required is one that implements the Iterable > interface (i.e., has a Symbol.interable method that returns an object that > implements the Iterator interface). What is unclear about that? > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

