Array comprehensions with Spread operator

Axel Rauschmayer axel at rauschma.de
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 gmail.com> wrote:
> 
> On Wed, Apr 15, 2015 at 9:31 AM, Jeremy Martin <jmar777 at gmail.com> 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 mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-- 
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de



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


More information about the es-discuss mailing list