fix/verbiage
parent
72cb38a839
commit
00b5ce97e3
|
@ -19,13 +19,13 @@ const user = {
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
Here's how to extract the values into variables with the same name as they have in the object:
|
Here's how to extract the values of object properties and assign them to variables with the same name:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { johnDoe: { age, email }} = user;
|
const { johnDoe: { age, email }} = user;
|
||||||
```
|
```
|
||||||
|
|
||||||
And here's how you can assign new variable names when destructuring a nested object:
|
And here's how you can assign an object properties' values to variables with different names:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { johnDoe: { age: userAge, email: userEmail }} = user;
|
const { johnDoe: { age: userAge, email: userEmail }} = user;
|
||||||
|
|
Loading…
Reference in New Issue