Skip to main content

Promise states

A promise has three states

StateNameWhat it means
pendingWaitingThe asynchronous operation has not finished yet. The promise is "in progress".
fulfilledResolved (successfully)The operation finished successfully, resolve(value) was called.
rejectedRejected (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.

javascript
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.

javascript
const promise = new Promise((resolve) => { resolve('Success!'); });

It now has a result, which can be handled in .then():

javascript
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.

javascript
const promise = new Promise((resolve, reject) => { reject('Network error'); });

The error can be caught via .catch():

javascript
promise.catch(error => console.log(error)); // Network error

Important: the transition happens only once

After moving to fulfilled or rejected, a promise becomes settled - and its state can no longer change.

javascript
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

javascript
(creation) │ ▼ pending / \ / \ (resolve) ▼ ▼ (reject) fulfilled rejected

Example with a delay

javascript
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:

javascript
pending... done

Summary

StateWhat it meansHow it transitionsWhat handles it
pendingWaiting for a result--
fulfilledThe operation finished successfullyresolve(value).then()
rejectedAn error occurred during executionreject(error) / throw.catch()
settledThe promise is finished (fulfilled or rejected)-.finally()

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.