function* test() {
yield 1+2
yield 2*2
return true
}
var demo = test()
console.log(demo.next()) // {value: 3, done: false}
function* test() {
yield 1+2
yield 2*2
return true
}
var demo = test()
console.log(demo.next()) // {value: 3, done: false}
转载于:https://my.oschina.net/u/3529405/blog/1814571