Constructs a new promise.
Optionalexecutor: (The executor function that is called immediately when the promise is constructed. It
is passed two functions, resolve and reject, that can be called to resolve or
reject the promise respectively.
Readonly[toStatic Readonly[species]Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.
Optionalonfinally: () => voidThe callback to execute when the Promise is settled (fulfilled or rejected).
A Promise for the completion of the callback.
Rejects the promise with the specified reason.
The reason for rejecting the promise.
StaticallCreates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected.
An array of Promises.
A new Promise.
StaticallCreates a Promise that is resolved with an array of results when all of the provided Promises resolve or reject.
An array of Promises.
A new Promise.
StaticdelayReturns a promise that is resolved after a specified delay.
The number of milliseconds to delay.
A promise that is resolved after the specified delay.
StaticraceStaticrejectCreates a new rejected promise for the provided reason.
Optionalreason: anyThe reason the promise was rejected.
A new rejected Promise.
StaticresolveCreates a new resolved promise.
A resolved promise.
The
Promiseclass is a subclass of the globalPromiseclass that adds the ability to resolve or reject the promise from outside of the executor function.