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()` runs as a microtask, not on the same tick.

Call Stack
before
Microtask Q
Code after await = a microtask

Tap the example to replay it · press and hold to slow it down

One of 40 cards in javascript flashcards. Browse every card.