Web features explorer

Promise.withResolvers()

Newly available since 2024-03-05
Tags: javascript Groups: JavaScript > Promises

The Promise.withResolvers() static method is an alternative to the Promise() constructor that returns both the promise and resolution functions. You can use this to access resolve and reject outside the scope of the executor function.

Learning resources on MDN

Browser support

Specifications