← Back to archive

Stdle #140 · modern · 2026-10-24

What does this TypeScript snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

function* gen(): Generator<number> { yield 3; yield 4 }
const it = gen()
console.log(it.next().value, [...it])
Modern
4 attempts left

Answer & explanation