From 3226888ad87e3447407ce7941c2ea528fc6e5f61 Mon Sep 17 00:00:00 2001 From: ruanyf Date: Wed, 25 Apr 2018 17:39:57 +0800 Subject: [PATCH] docs(acknowledgement): edit acknowledgement --- docs/acknowledgment.md | 5 +++++ docs/generator.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 docs/acknowledgment.md diff --git a/docs/acknowledgment.md b/docs/acknowledgment.md new file mode 100644 index 0000000..818faab --- /dev/null +++ b/docs/acknowledgment.md @@ -0,0 +1,5 @@ +# 鸣谢 + +## Generator + +网友 vision57 提出,`next()`、`throw()`、`return()`这三个方法本质上是同一件事,可以放在一起理解。它们的作用都是让 Generator 函数恢复执行,并且使用不同的语句替换`yield`表达式。 diff --git a/docs/generator.md b/docs/generator.md index 56f14e6..fde9a98 100644 --- a/docs/generator.md +++ b/docs/generator.md @@ -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`表达式替换成一个值。