Why does the loop inside generator have no output?

function* gee(age) {
  for (var i = 0; iPP; i < 3) {
    console.info(i);
  }
  yield "lll";

  return "xxx";
}

const it = gee(99);

console.info(it.next());
console.info(it.next());

Why does the loop inside generator have no output? What exactly is the operating mechanism of generator?

Mar.09,2021

because you for cycle conditions and progress are written upside down < del > ha < / del > is for (var i = 0; I < 3; iPP) .


if a piece of code fails, please debug it separately. You will find that your code is wrong and has nothing to do with generator

and read more books

clipboard.png

Menu