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

A render loop chains promises inside a recursive function and the browser still becomes unresponsive. Why does this `for` loop with `await` NOT yield to rendering between iterations the way the author expected?

async function busy() { for (let i = 0; i < 1e6; i++) { await Promise.resolve(i); // "yield" each step? } } busy();