De-structuring array arguments

Sultan thysultan at
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: <>

More information about the es-discuss mailing list