Array#flat is coming to ES; would you like like some sugar with that?

Michael Luder-Rosefield rosyatrandom at gmail.com
Thu Jun 21 11:23:05 UTC 2018


Apologies 'if' this is a terrible idea, but since I have just encountered a
situation where this sugar would actually be useful I'm absolutely going to
suggest it.

Extend the ... syntax to allow for flattening deconstructed arrays.
_Literally_ extend it:

....array === ...(array.flat()) // i.e. depth 1
.....array === ...(array.flat(0)) // unlimited depth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180621/38ab6b2c/attachment.html>


More information about the es-discuss mailing list