← Back to archive

Stdle #111 · async · 2026-09-19

What does this JavaScript snippet output?

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

function* g() {
const x = yield 'ask';
console.log('got ' + x);
}
const it = g();
it.next();
it.next(42);
Async
4 attempts left

Answer & explanation