//- With a generator function, values are not evaluated
//until they are needed.
//- Therefore a generator allows us to define a potentially
//infinite data structure.
function* generator() {
yield 1;
yield 2;
yield 3;
}
const gen = generator(); // "Generator { }"
console.log(gen.next().value); // 1
console.log(gen.next().value); // 2
console.log(gen.next().value); // 3