> There might also be occasions when we want to do something like this:
>
>    const { bar } = foo,
>          { baz, blah } = bar;
>
> Here, we might find it useful to get deconstructed references to both bar
and its properties baz and blah, but we have to do it in two steps.

Unless I’m misunderstanding what you mean, doing this in a single pattern
is already accounted for:

    const { bar, bar: { baz, blah } } = foo;

There’s no restriction on the number of times the key appears.
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to