Interview Q&A / JavaScript

IntermediateQuick answer1 min readUpdated 3 Oct 2026

How does promise chaining work, and what happens after a catch?

SHORT ANSWER

Every then returns a new promise, resolved with whatever the handler returns, so calls chain. A thrown error skips later then handlers until a catch, and after a catch that returns a value, the chain continues normally.

Explain it simply

A promise chain is a relay race. Each .then takes the baton (the previous result), does its work, and passes a new baton to the next runner. If a runner trips (throws), the next runners that only handle success are skipped, until someone with a .catch picks up the fall.

Two key rules: whatever you return from a handler becomes the next value, even a promise, which is waited for. And a catch that returns normally recovers the chain, so later .then calls run again.

Forgetting return is the classic bug: the next step then gets undefined.

Example

js
Promise.resolve(1)
  .then((v) => v + 1)
  .then((v) => {
    console.log(v);                // Output: 2
    throw new Error("boom");
  })
  .then(() => console.log("skipped"))
  .catch((e) => {
    console.log(e.message);        // Output: boom
    return "recovered";
  })
  .then((v) => console.log(v));    // Output: recovered

What to say in the interview

"Each then returns a new promise whose value is the handler's return value, which is why chaining works. Errors skip success handlers until a catch. If the catch returns a value, the chain recovers and continues. I always return inside handlers."

Common mistakes

  • Forgetting to return inside then, so the next handler receives undefined.
  • Nesting thens inside thens instead of flattening the chain.

#javascript#promises

Related questions

Practise more JavaScript questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open JavaScript quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.