Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

JavaScript · Function

Promise.resolve

Promise.resolve(value) converts a value, promise, or thenable into a Promise. It reuses eligible existing promises, assimilates thenables, and fulfills with ordinary values.

How it works

Promise.resolve(value) produces a promise associated with value. Existing native Promise instances may be returned unchanged; thenables are assimilated by calling then, while ordinary values become fulfillment values, and nested promise-like layers are flattened.

Syntax

Promise.resolve(value)

Parameters

NameTypeDescription
valueanyThe value to resolve; it may be an ordinary value, a Promise, or a thenable.

Returns

A Promise resolved with the supplied value, or the supplied promise when it can be reused. The resulting promise may be fulfilled, rejected, or pending while following another promise-like object.

Key points

  • It is a static method on Promise that normalizes an input into promise-based control flow.
  • Non-thenable inputs become the fulfillment value of the returned promise.
  • Promise-like nesting is collapsed so consumers handle one promise layer rather than recursively unwrapping it.
  • An eligible existing promise is reused instead of being wrapped in another promise.
  • Thenable assimilation invokes its then method with resolving functions supplied by the implementation.

Common mistakes

  • “Resolved” does not necessarily mean fulfilled: the returned promise can remain pending or can be rejected while following another promise or thenable.
  • Passing an existing promise can preserve its identity rather than creating a wrapper; this behavior is specific to the applicable Promise constructor and instance.
  • Do not treat the method name as an immediate fulfillment operation; resolution establishes what outcome the returned promise will follow.

Example: Assimilate a thenable

const thenable = {
  then(resolve) {
    resolve(42);
  },
};

const promise = Promise.resolve(thenable);
promise.then(console.log); // 42

A thenable is assimilated, so the returned promise adopts the value supplied to its then method.

When to use it

Normalize mixed inputs

An API accepts either synchronous values or promises and should expose one consistent promise-based result.

Adopt a thenable

Code interoperates with a promise-like object supplied by another library or implementation.

Create a fulfilled promise

A function needs to return an immediately fulfilled promise without manually invoking the Promise constructor.

Flatten promise layers

Promise-like results may be nested through multiple asynchronous layers and need one consumable promise.

Interview questions

QWhat does Promise.resolve do?

It converts a value into a promise. A native promise can be returned directly, a thenable is assimilated by invoking its then method, and an ordinary value produces a fulfilled promise.

Follow-up: What happens with nested promise-like values? Their layers are flattened, so the resulting promise follows the eventual non-thenable outcome.

QWhat are its parameter and return value?

The argument is the value to resolve and may be an ordinary value, a Promise, or a thenable. The method returns a Promise resolved with that argument or the passed promise when identity-preserving conditions apply.

Follow-up: Can a resolved promise be rejected? Yes: resolution may make it follow a rejected promise or thenable, so resolved and fulfilled are different concepts.

QHow does Promise.resolve handle thenables?

A thenable is an object with a then method. Promise.resolve calls that method with resolving callbacks, allowing the returned promise to adopt the thenable's eventual state.

Follow-up: Why assimilate thenables? It lets native promises interoperate with promise-like objects from other implementations or libraries.

  • Promise
  • Promise.reject()
  • Promise.all()
  • Promise.allSettled()
  • Promise.prototype.then()
  • Promise.prototype.catch()

Source: Promise.resolve() - JavaScript | MDN Web Docs. Checked 2026-10-15.