← Back to archive

Stdle #77 · async · 2026-08-16

What does this JavaScript snippet output?

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

function delay(v) { return new Promise(res => setTimeout(() => res(v), 0)); }
const r = await delay(1) + await delay(2);
console.log(r);
Async
4 attempts left

Answer & explanation