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

Merge branch 'gh-pages' of github.com:ruanyf/es6tutorial into gh-pages

This commit is contained in:
ruanyf 2017-04-06 17:45:19 +08:00
commit 60657db152

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){