← Back to archive

Stdle #178 · async · 2026-11-25

What does this JavaScript snippet output?

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

const obj = {
vals: [5, 6],
*gen() { for (const v of this.vals) yield v; },
};
console.log([...obj.gen()].join(','));
Async
4 attempts left

Answer & explanation