mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-25 11:12:21 +00:00
Update destructuring.md
This commit is contained in:
parent
c3a4a17afa
commit
bd2840d8ac
@ -170,7 +170,7 @@ let [x = y, y = 1] = []; // ReferenceError: y is not defined
|
|||||||
|
|
||||||
### 简介
|
### 简介
|
||||||
|
|
||||||
解构不仅可以用于数组,还可以用于对象。
|
解构不仅可以用于数组,还可以用于对象。需要注意的是,对象的解构赋值只是一种浅拷贝。
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
let { foo, bar } = { foo: 'aaa', bar: 'bbb' };
|
let { foo, bar } = { foo: 'aaa', bar: 'bbb' };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user