Brendan Eich wrote:
Herby Vojčík wrote:
As was already pointed out, problems are not only _array_
destructurings, but more argument list destructrings, where if you
want to destructure 0-th argument both as b and as {x,y}, you would
need something like that, since you already are inside list, you
cannot opt for object.

Why can't you use an object pattern? Array pattern is just shorthand for
object pattern.

Not implicitly, not inside the argument list itself.
You would need to write

  function foo (...args) {
    let {0:b, 0:{x,y}, foo, bar, baz} = args;
    ...
  }

but between 'foo (' and ') {' you must play by the rules of array destructuring, where '0:' is not allowed.

/be

Herby
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to