Async Model for JavaScripts
The JavaScript async model explains how a single-threaded language handles waiting: the call stack runs code, web APIs handle timers and requests, and the event loop moves finished callbacks and promise reactions back for execution. This unit in the Asynchronous JavaScript stage teaches ordering rules and how promises represent future values.
Stage: Asynchronous JavaScript · Part of the JavaScript roadmap · Last reviewed 19 November 2026
What to learn in Async Model
- Explain how the call stack, task queue and event loop interact
- Predict the output order of setTimeout, a promise and synchronous logs
- Create a promise and handle results with then, catch and finally
- Run several promises together with Promise.all and Promise.allSettled
- Describe why long synchronous work blocks the page
Async Model interview questions
What is the difference between the microtask queue and the task queue?
Promise callbacks go to the microtask queue, while timers and events go to the task queue. After each task, the event loop drains all microtasks before taking the next task. So a resolved promise handler runs before a setTimeout of zero.
What is the difference between Promise.all and Promise.allSettled?
Promise.all rejects as soon as any promise rejects, and otherwise gives an array of results. Promise.allSettled waits for every promise and reports an array of status objects, so you can inspect both successes and failures without losing results.
Where Async Model fits in the JavaScript roadmap
Async Model belongs to the Asynchronous JavaScript stage (beginner level), which takes about 28 hours. Work with time and the network.
Other units in this stage
Back to the full JavaScript roadmap