console.log

by yakun chen

JavaScript

// generator 函数返回一个遍历器对象
// 代表的是 Generator 函数内部的指针
// 惰性求值
function* helloWorldGenerator() {
 // yield 'hello';
 	yield 'world';
  return 'ending';
}

var hw = helloWorldGenerator();

console.log(hw.next())
console.log(hw.next())