From 2b9fe071df09f98f7254609728f887efb8e80d69 Mon Sep 17 00:00:00 2001 From: ruanyf Date: Thu, 9 Feb 2017 13:55:23 +0800 Subject: [PATCH] docs(object): edit spread operator --- docs/object.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/object.md b/docs/object.md index 1958b1c..4c94623 100644 --- a/docs/object.md +++ b/docs/object.md @@ -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)解构赋值**