Can someone help me understand what the following code is doing? Why is "one" not printed to the console? Also, is g the generator or is go the generator?
function *go() {
var foo = yield;
console.log(foo);
}
var g = go();
console.log(g.next('one'));
console.log(g.next('two'));
Output:
Object {value: undefined, done: false}
two
Object {value: undefined, done: true}