1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 10:22:23 +00:00

docs(acknowledgement): edit acknowledgement

This commit is contained in:
ruanyf 2018-04-25 17:39:57 +08:00
parent b48a35bebb
commit 3226888ad8
2 changed files with 6 additions and 1 deletions

5
docs/acknowledgment.md Normal file
View File

@ -0,0 +1,5 @@
# 鸣谢
## Generator
网友 vision57 提出,`next()``throw()``return()`这三个方法本质上是同一件事,可以放在一起理解。它们的作用都是让 Generator 函数恢复执行,并且使用不同的语句替换`yield`表达式。

View File

@ -708,7 +708,7 @@ g.next() // { value: 7, done: true }
## next()、throw()、return() 的共同点
网友 vision57 提出,`next()``throw()``return()`这三个方法本质上是同一件事,可以放在一起理解。它们的作用都是让 Generator 函数恢复执行,并且使用不同的语句替换`yield`表达式。
`next()``throw()``return()`这三个方法本质上是同一件事,可以放在一起理解。它们的作用都是让 Generator 函数恢复执行,并且使用不同的语句替换`yield`表达式。
`next()`是将`yield`表达式替换成一个值。