JavaScript Promise.resolve() Method
The Promise.resolve() static method returns a promise that is already fulfilled with a given value.
Description
The Promise.resolve() static method returns a fulfilled promise with the given value. If the value is already a promise, that promise is returned. It's useful when a function should always return a promise even when the result is available straight away, such as from a cache.
When given a "thenable", any object with a then() method, it adopts that object's eventual state, which is how promises from different libraries can work together. Wrapping a value with Promise.resolve() also guarantees that any then() callbacks run asynchronously, after the current code finishes.
Inside an async function, returning a value does the same thing automatically, so Promise.resolve() is mostly needed in code that builds promise chains by hand.
Syntax
Promise.resolve(value)Parameters
- valueThe value to resolve with, or a promise or thenable to follow.
Return Value
A promise fulfilled with the value (or the same promise, if one was passed).
Example
Browser Support
The following information will show you the current browser support for the Promise.resolve() method. Hover over a browser icon to see the version that first introduced support for this method.
Desktop





Tablets & Mobile





