On 28 August 2013 17:02, Forbes Lindesay <for...@lindesay.co.uk> wrote: > It would be nice from a readability point of view if `iteratable.toArray()` > could always be used as a substitute for `Array.from(iteratable)`. Is there > a way that could be neatly achieved? It would also be nice if methods like > `.map` and `.filter` existed on iteratables. C# does this via the concept > of extension methods, but I wonder whether something similar could be > achieved here, at least in the case of built in iteratables?
In addition to what others have already said, note that iterators model streams that are not necessarily finite. Hence, a toArray method would not generally be well-defined. /Andreas _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss