What will the following generator function output?
function* generator() {
yield 1;
yield 2;
yield 3;
}
const gen = generator();
console.log(gen.next().value);
1
2
undefined
Error
This question is part of this quiz :
Advanced JavaScript