Promise Combinators in JavaScript

From the Async JavaScript cheat sheet · Promises · verified Jul 2026

Promise Combinators

Utility methods for coordinating multiple promises with different execution strategies

javascript
// Promise.all - all must succeed
Promise.all([p1, p2, p3])
  .then(results => console.log(results));

// Promise.race - first to settle wins
Promise.race([p1, p2, p3])
  .then(winner => console.log(winner));

// Promise.allSettled - wait for all
Promise.allSettled([p1, p2, p3])
  .then(results => results.forEach(r => 
    console.log(r.status, r.value || r.reason)
  ));

// Promise.any - first success wins
Promise.any([p1, p2, p3])
  .then(first => console.log(first));
💡 Promise.all fails fast - rejects if any promise rejects
✅ Promise.allSettled waits for all regardless of outcome
⚡ Promise.race returns first to settle (resolve or reject)
🔄 Promise.any returns first to resolve, ignores rejections

Continue with Async JavaScript

Save the full cheat sheet or work through every related task.

More JavaScript tasks

Back to the full Async JavaScript cheat sheet