docs(object): edit spread operator

This commit is contained in:
ruanyf
2017-02-09 13:55:23 +08:00
parent d042de53e6
commit 2b9fe071df
+9 -1
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)解构赋值**