Caffeinated Coder
Book an appointment
Lesson 20 · Async JavaScript

async and await

async and await let you write code that waits for a slow answer, such as a reply from a server, as plain step-by-step code, without freezing the page. Follow one async function from its first line to await, watch it step off the engine while the rest of the script runs, and see it come back through the microtask queue when its promise is fulfilled.

11 min12 steps5 questionsIntermediate
Fig 20 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.