Imagine I have coded an ES6 generator
function *createFibonacciIterator(a = 0, b = 1) {
yield b;
yield *generateNextFibonacci(b, b + a); // <== INQUIRING ABOUT THIS LINE
}
Now, I utilize this generator to obtain the initial 20 results
let fibber = createFibonacciIterator();
for (let ii = 0; ii < 20; ii++) {
console.log(fibber.next());
}
If I exclude the *
from the
yield *generateNextFibonacci(b, b + a);
line, it leads to issues, as I intend to yield a value rather than an iterator.
What does the *
symbol signify in the context of generators?