Promise States: Pending, Fulfilled, Rejected in JavaScript
A promise transitions through three states. Here is how and when it transitions.
Promise States: Pending, Fulfilled, Rejected in JavaScript
A promise has three states. Understanding the transitions is essential for working with promises.
The States
- Pending: the initial state. The promise is waiting for the async operation to complete.
- Fulfilled: the operation succeeded. The promise has a value.
resolve(value)was called. - Rejected: the operation failed. The promise has a reason (error).
reject(reason)was called.
Transitions
pending -> fulfilled (resolve called)
pending -> rejected (reject called)
``
A promise can only transition **once**. Once settled (fulfilled or rejected), it cannot change state.
```js
const p = new Promise((resolve, reject) => {
resolve("first"); // fulfilled with "first"
resolve("second"); // ignored (already settled)
reject("error"); // ignored (already settled)
});
p.then((v) => console.log(v)); // "first"
``
### Checking State
There is no direct way to check a promise's state from outside (no `promise.state` property). You can only react to settlement via `.then`/`.catch`/`.finally`.
However, you can track it yourself:
```js
function track(promise) {
let state = "pending";
promise.then(() => { state = "fulfilled"; }, () => { state = "rejected"; });
return () => state;
}
``
### Already Settled Promises
```js
Promise.resolve(42); // a promise fulfilled with 42
Promise.reject(new Error("oops")); // a promise rejected with an error
``
These are already settled. `.then`/`.catch` still run (as microtasks).
### The Takeaway
A promise starts pending, then transitions to fulfilled (`resolve`) or rejected (`reject`) once. It cannot change state after settling. `Promise.resolve` and `Promise.reject` create already-settled promises. There is no direct way to check state from outside; you react via `.then`/`.catch`.
Pending (initial, waiting for the operation to complete), fulfilled (operation succeeded, resolve was called), and rejected (operation failed, reject was called). A promise transitions from pending to fulfilled or rejected once.
No. A promise can only transition once: from pending to fulfilled or from pending to rejected. Once settled, it cannot change state. Subsequent resolve/reject calls are ignored.
Use Promise.resolve(value) for an already-fulfilled promise. Use Promise.reject(reason) for an already-rejected promise. These are settled immediately. .then/.catch still run (as microtasks).
No. There is no promise.state property. You can only react to settlement via .then, .catch, and .finally. If you need to track state, do it yourself by attaching .then and .catch handlers that update a variable.
The first resolve wins. The promise fulfills with the first value. The second resolve (and any subsequent resolve/reject) is ignored because the promise is already settled.
Ready to master React completely?
Want to upskill yourself, crack your next interview, and get your dream job? Join our comprehensive course to dive deeper with high-quality video tutorials, solve interview questions, and a premium community.
Master React
Want to upskill yourself, crack your next interview, and get your dream job? Join our comprehensive course.

