I didn't mean that part when I said multiple levels. I meant the following 

```
const abc = { { bcd, cde, efg: {qnc} } = obj};

```

This would most definitely seem strange as to why the outer {} is needed for picking from a single object 

Sent: October 25, 2017 8:10 AM
Subject: Re: Extend Object Dereferencing

On Tue, Oct 24, 2017 at 7:51 PM, Sebastian Malton
>
> 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


```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