📜  javascript代码示例中的生成器

📅  最后修改于: 2022-03-11 15:03:04.103000             🧑  作者: Mango

代码示例2
function* g(){    //or function *g(){}
  console.log("First");
  yield 1;
  console.log("second");
   yield 2;
  console.log("third");
} 
let generator=g();
generator.next();
generator.next();