Module 13 · Async 2: Promises, async/await and fetch
Under the Hood: Microtasks, the Turns an await Costs, Thenables and Unhandled Rejections
ProReading
Module 12 drew the event loop with two queues. The task queue holds timers and I/O, and the microtask queue was named but left for later. This lesson finishes that picture, because promises live in the second queue. Once you see it, the print-order puzzles of interviews stop being puzzles.
Checking what this lesson needs for you…
What is inside Under the Hood: Microtasks, the Turns an await Costs, Thenables and Unhandled Rejections
- Microtasks, finished
- How many turns an await costs
- A returned promise costs two more turns
- Thenables: anything with a then
- What an async function returns when it throws
- Unhandled rejections in Node 22