mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 18:32:22 +00:00
update generator-async.md
‘next法返回值的value属性’改为‘next返回值的value属性’
This commit is contained in:
parent
f29bae250d
commit
87c0669a0b
@ -138,7 +138,7 @@ g.next() // { value: undefined, done: true }
|
|||||||
|
|
||||||
Generator 函数可以暂停执行和恢复执行,这是它能封装异步任务的根本原因。除此之外,它还有两个特性,使它可以作为异步编程的完整解决方案:函数体内外的数据交换和错误处理机制。
|
Generator 函数可以暂停执行和恢复执行,这是它能封装异步任务的根本原因。除此之外,它还有两个特性,使它可以作为异步编程的完整解决方案:函数体内外的数据交换和错误处理机制。
|
||||||
|
|
||||||
`next`法返回值的value属性,是 Generator 函数向外输出数据;`next`方法还可以接受参数,向 Generator 函数体内输入数据。
|
`next`返回值的value属性,是 Generator 函数向外输出数据;`next`方法还可以接受参数,向 Generator 函数体内输入数据。
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
function* gen(x){
|
function* gen(x){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user