Array comprehensions with Spread operator

Jeremy Martin jmar777 at gmail.com
Wed Apr 15 16:31:29 UTC 2015


Why not just `[...x, ...y]`?

On Wed, Apr 15, 2015 at 12:23 PM, monolithed <monolithed at gmail.com> wrote:

> ```js
> let x = [0, 1, 2];
> let y = [3, 4, 5];
>
>
> // Expected
> [ for (i of [x, y]) ...i ];
>
>
> // Reality
> Array.prototype.concat(...[ for (x of [x, y]) i ]);
>
>
> // Result
> [0, 1, 2, 3, 4, 5]
> ```
>
> Is there any discussion on this subject?
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>


-- 
Jeremy Martin
661.312.3853
http://devsmash.com
@jmar777
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150415/73474f9d/attachment.html>


More information about the es-discuss mailing list