TGViewer
JavaScript JavaScript @javascript · 31K subscribers
Post #3555 488
CHALLENGE

function* inner() {
const x = yield 1;
yield x + 1;
return 100;
}

function* outer() {
const result = yield* inner();
yield result;
}

const g = outer();
console.log(g.next().value, g.next(10).value, g.next().value, g.next().value);
  • ❤ 1
More from @javascript
  1. Oct 13, 2026Post #3556
  2. Oct 12, 2026Post #3554
  3. Oct 12, 2026CHALLENGE const arr = [1, [2, 3], [4, [5, 6]]]; const a = arr.flat(); const b = arr.flat(I…
  4. Oct 11, 2026Post #3552
  5. Oct 11, 2026CHALLENGE const output = []; output.push(typeof foo); try { output.push(typeof bar); } cat…
  6. Oct 10, 2026Post #3550
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →