1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00

docs(object): edit spread operator

This commit is contained in:
ruanyf 2017-02-09 13:55:23 +08:00
parent d042de53e6
commit 2b9fe071df

View File

@ -924,7 +924,15 @@ function entries(obj) {
## 对象的扩展运算符
目前ES7有一个[提案](https://github.com/sebmarkbage/ecmascript-rest-spread)将Rest运算符解构赋值/扩展运算符(`...`引入对象。Babel转码器已经支持这项功能。
《数组的扩展》一章中,已经介绍过扩展预算符(`...`)。
```javascript
const [a, ...b] = [1, 2, 3];
a // 1
b // [2, 3]
```
ES2017 将这个运算符[引入](https://github.com/sebmarkbage/ecmascript-rest-spread)了对象。
**1解构赋值**