From b8959b2e6d63acc7671cfc8beefae8df7208e91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=81=A5=E8=B6=85?= <574805242@qq.com> Date: Tue, 28 Mar 2017 19:34:01 +0800 Subject: [PATCH 1/2] Update object.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 错别字:“预算”->“运算” --- docs/object.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/object.md b/docs/object.md index 8ac6d75..62b5399 100644 --- a/docs/object.md +++ b/docs/object.md @@ -991,7 +991,7 @@ function entries(obj) { ## 对象的扩展运算符 -《数组的扩展》一章中,已经介绍过扩展预算符(`...`)。 +《数组的扩展》一章中,已经介绍过扩展运算符(`...`)。 ```javascript const [a, ...b] = [1, 2, 3]; From cd360410cfa3343484fe669e973ea13f8af8b7bf Mon Sep 17 00:00:00 2001 From: Toxichl <472590061@qq.com> Date: Wed, 29 Mar 2017 14:46:42 +0800 Subject: [PATCH 2/2] The position of the asterisk is incorrect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Combined with the previous content: ``` 由于Generator函数仍然是普通函数,所以一般的写法是上面的第三种,即星号紧跟在`function`关键字后面。**本书也采用这种写法**。 ``` so, the position of the asterisk is incorrect ... --- docs/generator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generator.md b/docs/generator.md index b2b388a..aa44375 100644 --- a/docs/generator.md +++ b/docs/generator.md @@ -585,7 +585,7 @@ try { Generator函数体外抛出的错误,可以在函数体内捕获;反过来,Generator函数体内抛出的错误,也可以被函数体外的`catch`捕获。 ```javascript -function *foo() { +function* foo() { var x = yield 3; var y = x.toUpperCase(); yield y;