De-structuring array arguments

Sultan thysultan at gmail.com
Thu Jan 17 17:50:20 UTC 2019


Consider the following is not possible today:

function foo ([a, b] = [1, 2]) {}

foo([2, 3])

While the the following is outside of function arguments:

const arr = [1, 2]
const [a, b] = arr

Is there any reason for the current status quo?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190117/b9e6e66e/attachment.html>


More information about the es-discuss mailing list