Standard built-ins

Promise.resolve()

Try the free JavaScript compiler

Returns a promise resolved to the value, adopting thenables. For an existing promise with the matching constructor, the method returns that promise unchanged.

Formal Syntax & Structure

javascript syntaxjavascript
Promise.resolve(value)

Parameters & Attributes

NameTypeDescription
valueanyValue or thenable to resolve.

Return Value

Promise

Promise resolved to the value.

Working Example

Example Snippetjavascript
const p=Promise.resolve(4); console.log(Promise.resolve(p)===p); p.then(console.log);
JavaScript Reference