title: ES Promise.withResolvers (2023) status: proposal stage: 2 location: https://github.com/tc39/proposal-promise-with-resolvers copyright: false contributors: Peter Klecha
This is the formal specification for a proposed `Promise.withResolvers` method in JavaScript. It modifies the original ECMAScript specification with several new or revised clauses. See the proposal's explainer for the proposal's background, motivation, and usage examples.
This function returns an object with three properties: a new promise plus the `resolve` and `reject` functions associated with that promise.