async function* gen() {
const x = yield 1;
const y = yield x + 1;
return x + y;
}
async function main() {
const it = gen();
const a = await it.next();
const b = await it.next(10);
const c = await it.next(20);
console.log(`${a.value} ${b.value} ${c.value} ${c.done}`);
}
main(); Post #3541
579
CHALLENGE