I have this code:
function* showValue() {
setTimeout(function*() {
console.log('yielding')
return yield 100;
}, 1000);
}
var valFunc = showValue();
console.log(valFunc.next());
When I run it, I see this output:
{ value: undefined, done: true }
Why should I do to have the .next()
call return 100?