Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaScriptpractical event-loop modelSingle-choice MCQ

What does this log? The key is how `await` schedules the continuation relative to a synchronous `setTimeout(…, 0)`.

async function run() { console.log(1); await null; console.log(2); } setTimeout(() => console.log(3), 0); run(); console.log(4);