Skip to content

Commit 51c2cf0

Browse files
authored
感觉这句话有点歧义
我看的时候以为反之是`用前者代替后者` 的意思,感觉加上这句话会更直观一点..不知道是不是自己理解错了
1 parent d4501ea commit 51c2cf0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/generator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ function* concat(iter1, iter2) {
843843
}
844844
```
845845

846-
上面代码说明,`yield*`后面的Generator函数(没有`return`语句时),不过是`for...of`的一种简写形式,完全可以用后者替代前者。反之,则需要用`var value = yield* iterator`的形式获取`return`语句的值。
846+
上面代码说明,`yield*`后面的Generator函数(没有`return`语句时),不过是`for...of`的一种简写形式,完全可以用后者替代前者。反之,在有`return`语句时,则需要用`var value = yield* iterator`的形式获取`return`语句的值。
847847

848848
如果`yield*`后面跟着一个数组,由于数组原生支持遍历器,因此就会遍历数组成员。
849849

0 commit comments

Comments
 (0)