← Back to archive

Stdle #37 · async · 2026-07-07

What does this JavaScript snippet output?

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

console.log('start');
setTimeout(() => console.log('timeout'), 0);
Promise.resolve().then(() => console.log('promise'));
console.log('end');
Async
4 lines
4 attempts left

Answer & explanation