← Back to archive

Stdle #152 · modern · 2026-11-05

What does this TypeScript snippet output?

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

const r: Iterable<number> = {
*[Symbol.iterator]() { yield 1; yield 2 }
}
console.log([...r])
Modern
4 attempts left

Answer & explanation