Skip to content

Commit 2b9fe07

Browse files
committed
docs(object): edit spread operator
1 parent d042de5 commit 2b9fe07

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/object.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,15 @@ function entries(obj) {
924924

925925
## 对象的扩展运算符
926926

927-
目前,ES7有一个[提案](https://github.com/sebmarkbage/ecmascript-rest-spread),将Rest运算符(解构赋值)/扩展运算符(`...`)引入对象。Babel转码器已经支持这项功能。
927+
《数组的扩展》一章中,已经介绍过扩展预算符(`...`)。
928+
929+
```javascript
930+
const [a, ...b] = [1, 2, 3];
931+
a // 1
932+
b // [2, 3]
933+
```
934+
935+
ES2017 将这个运算符[引入](https://github.com/sebmarkbage/ecmascript-rest-spread)了对象。
928936

929937
**(1)解构赋值**
930938

0 commit comments

Comments
 (0)