`.toArray()` for all generators

Axel Rauschmayer axel at rauschma.de
Wed Aug 28 08:07:37 PDT 2013

On Aug 28, 2013, at 17:02 , Forbes Lindesay <forbes at 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?

For me, [ ... iterable ] would be good enough. Relatively readable and concise.

> 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?

It would be lovely to have a module with tool functions for this, similar to Python’s itertools.

Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130828/b95a8ba5/attachment.html>

More information about the es-discuss mailing list