06
Promises & async

Promises & async

The promise model and the event loop, demystified — written for people who just want their code to work.

~ 100 min·7 lessons·updated apr 2026

What you'll learn


Lessons

Read in order. Each lesson stands on its own, but the order is deliberate.

7 lessons · ~100 min total

  1. 01
    Why callbacks weren't enough
    The callback pyramid, lost errors, and the trust problem that promises were built to fix.
    11 min
  2. 02
    What a promise is
    A receipt for a value that hasn't arrived yet. Pending, fulfilled, rejected — and why settle is final.
    13 min
  3. 03
    then, catch, finally
    Chaining without nesting. Each then is a new promise; returning one flattens it.
    14 min
  4. 04
    async / await
    The same promises, written like procedures. Where the function pauses and where it resumes.
    15 min
  5. 05
    Parallel vs sequential
    Promise.all, allSettled, race, any. Choosing the right combinator for the job.
    14 min
  6. 06
    Errors in async code
    try / catch around await, unhandled rejections, and the rule that keeps you safe.
    14 min
  7. 07
    Microtasks and the event loop
    Why your console.log order surprises you. The microtask queue, the macrotask queue, and how they take turns.
    19 min

Prerequisites

  • · JavaScript Functions
  • · Comfortable with arrow functions

After this, try