Course contentsShow
← JavaScript
Lesson 1285 of 2,72329. PromisesFree lesson

Multiple .then() Handlers on One Promise

Discover that attaching multiple .then() to the same Promise creates independent branches, not a sequential chain.

Multiple .then() Handlers on One Promise

You'll learn that attaching multiple .then() handlers to the same Promise creates independent branches, not a sequential chain.

The Core Idea

When you call .then() on a Promise, it returns a new Promise. But you can also call .then() multiple times on the original Promise. Each of these handlers receives the same resolved value and runs independently—they don't form a chain with each other.

Think of it like a river splitting into separate streams. All streams start from the same source (the original Promise's resolved value), but what happens in one stream doesn't affect the others.

Sequential Chain vs Independent Branches

const promise = Promise.resolve(5);

// Sequential chain - each .then() receives previous result
promise
  .then(value => value * 2)  // gets 5, returns 10
  .then(value => value + 3); // gets 10, returns 13

// Independent branches - both receive original value
promise.then(value => console.log(value * 2));  // logs 10
promise.then(value => console.log(value + 3));  // logs 8

In the first example, we chain off the return value of each .then(). In the second, both handlers attach to promise directly, so both receive 5.

Why This Matters

You might accidentally create branches when you meant to chain:

const promise = Promise.resolve(10);
promise.then(value => value * 2);
promise.then(value => console.log(value)); // logs 10, not 20!

Each .then() on promise starts fresh from the original resolved value.

Key Takeaway: Multiple .then() handlers on the same Promise create independent execution branches that all receive the original resolved value, not a sequential chain where each handler receives the previous handler's return value.