De-structuring array arguments

Tab Atkins Jr. jackalmage at gmail.com
Thu Jan 17 22:43:29 UTC 2019


On Thu, Jan 17, 2019 at 1:36 PM Jordan Harband <ljharb at gmail.com> wrote:
> I'm not sure what you mean, that should certainly be possible today. In node, I get this:
>
> ```
> function foo ([a, b] = [1, 2]) { return [a, b]; }
> foo([2, 3]) // [2, 3]
> foo() // [1, 2]
> ```

Yup, and you get the same in browsers. It definitely works today.

~TJ


More information about the es-discuss mailing list