Event Loop

async / await

Syntactic sugar over promises. Code before await runs synchronously; everything after await is queued as a microtask that resumes once the awaited value settles.

The line after `await fetch()` resumes as a microtask once the fetch settles — never synchronously.

Call stack
before
Microtask queue
Watch await queue a microtask

One of 40 cards in the JavaScript deck. Browse every card.