1
0
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:
请叫我王磊同学(Wanglei) 2017-04-01 17:17:44 +08:00 committed by GitHub
parent f29bae250d
commit 87c0669a0b

View File

@ -138,7 +138,7 @@ g.next() // { value: undefined, done: true }
Generator 函数可以暂停执行和恢复执行,这是它能封装异步任务的根本原因。除此之外,它还有两个特性,使它可以作为异步编程的完整解决方案:函数体内外的数据交换和错误处理机制。
`next`返回值的value属性是 Generator 函数向外输出数据;`next`方法还可以接受参数,向 Generator 函数体内输入数据。
`next`返回值的value属性是 Generator 函数向外输出数据;`next`方法还可以接受参数,向 Generator 函数体内输入数据。
```javascript
function* gen(x){