Promise states
A promise has three states
| State | Name | What it means |
|---|---|---|
pending | Waiting | The asynchronous operation has not finished yet. The promise is "in progress". |
fulfilled | Resolved (successfully) | The operation finished successfully, resolve(value) was called. |
rejected | Rejected (with an error) | The operation finished with an error, reject(reason) was called or an exception was thrown. |
The pending state (waiting)
A promise is created in this state by default.
const promise = new Promise(() => {
// nothing called yet → pending
});It has no result and waits until resolve() or reject() is called.
The fulfilled state (resolved successfully)
A promise becomes fulfilled when resolve(value) is called.
const promise = new Promise((resolve) => {
resolve('Success!');
});It now has a result, which can be handled in .then():
promise.then(value => console.log(value)); // Success!The rejected state (finished with an error)
A promise becomes rejected when reject(reason) is called
or an error is thrown (throw) inside the promise body.
const promise = new Promise((resolve, reject) => {
reject('Network error');
});The error can be caught via .catch():
promise.catch(error => console.log(error)); // Network errorImportant: the transition happens only once
After moving to fulfilled or rejected,
a promise becomes settled - and its state can no longer change.
const promise = new Promise((resolve, reject) => {
resolve('OK');
reject('Error'); // ignored
});The promise "locked in" as fulfilled and will not change state anymore.
An additional term: "settled"
"Settled" is a general state where a promise is already not pending, meaning it is:
- either
fulfilled, - or
rejected.
All settled promises are called settled, but not all settled promises are "successful".
A visual diagram of transitions
(creation)
│
▼
pending
/ \
/ \
(resolve) ▼ ▼ (reject)
fulfilled rejectedExample with a delay
const promise = new Promise((resolve, reject) => {
console.log('pending...');
setTimeout(() => resolve('done'), 2000);
});
promise
.then(res => console.log(res))
.catch(err => console.error(err));Sequence:
pending...
doneSummary
| State | What it means | How it transitions | What handles it |
|---|---|---|---|
pending | Waiting for a result | - | - |
fulfilled | The operation finished successfully | resolve(value) | .then() |
rejected | An error occurred during execution | reject(error) / throw | .catch() |
settled | The promise is finished (fulfilled or rejected) | - | .finally() |
Short Answer
Interview readyA concise answer to help you respond confidently on this topic during an interview.