function* generatorOne(){
yield ['a','b','c'];
}
function* generatorTwo(){
yield* ['a','b','c'];
}
const one = generatorOne();
const two = generatorTwo();
one.next().value; // ['a','b','c']
two.next().value; // a
function* generatorOne(){
yield ['a','b','c'];
}
function* generatorTwo(){
yield* ['a','b','c'];
}
const one = generatorOne();
const two = generatorTwo();
one.next().value; // ['a','b','c']
two.next().value; // a
本文标题:yield和generaotor
本文链接:https://www.haomeiwen.com/subject/hjuuwltx.html
网友评论