Array comprehensions with Spread operator

Axel Rauschmayer axel at
Wed Apr 15 17:20:55 UTC 2015

It’s important to keep in mind that there is no official version of array comprehensions, at the moment. So that is something to keep in mind whenever they are added to the language.

I’d probably implement flatMap() and use it if I ever needed to do something like this.

> On 15 Apr 2015, at 18:34, Tab Atkins Jr. <jackalmage at> wrote:
> On Wed, Apr 15, 2015 at 9:31 AM, Jeremy Martin <jmar777 at> wrote:
>> Why not just `[...x, ...y]`?
> Obviously that's a solution to the trivial example that monolithed
> provided, but it's not a solution to the more general problem he's
> alluding to, where you're doing a comprehension and want to insert two
> or more elements into the result in a single iteration.
> ~TJ
> _______________________________________________
> es-discuss mailing list
> es-discuss at

Dr. Axel Rauschmayer
axel at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list