On Tue, Oct 24, 2017 at 7:51 PM, Sebastian Malton
<[email protected]> wrote:
>
> Currently you can do the following
>
> const {abc, xyz, qnc} = obj;
>
> However if you want to go more than one level deep then you have
> to do it again for each level.

You don't have to do it again, you can nest patterns as deeply as you like.
In this case:

```js
const {abc, xyz, qnc: {awj}} = obj;
```j

E.g.: http://jsfiddle.net/yyud2gvg/

```js
const obj = {
    abc: 1,
    xyz: 2,
    qnc: {
        awj: 3
    }
};
const {abc, xyz, qnc: {awj}} = obj;
console.log(abc, xyz, awj); // 1, 2, 3
```js

-- T.J. Crowder
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to