An object representing the eventual result of an async operation. It is a placeholder for a future value. A promise has three states: pending, fulfilled, and rejected. It settles (fulfills or rejects) exactly once.
What is a promise in JavaScript?
More FAQs in What Are Promises in JavaScript?
Pending (initial, not yet settled), fulfilled (operation succeeded, has a value), and rejected (operation failed, has a reason/error). A promise transitions from pending to fulfilled or rejected once and cannot change state after settling.
Use new Promise((resolve, reject) => { ... }). The executor function runs immediately. Call resolve(value) to fulfill the promise, or reject(reason) to reject it. The executor usually starts an async operation.
Promises guarantee once-only settlement (no inversion of control), enable flat chaining with .then, use a single .catch for all errors, provide Promise.all for parallel operations, and enable async/await for synchronous-looking code.
Still have questions?
Browse all our FAQs or reach out to our support team
Want to upskill yourself?
Your learning library
Small steps. Big possibilities.
Find your next course. Build something great.