The PromiseRejectionEvent()
constructor returns a newly created PromiseRejectionEvent
, which represents events fired when a JavaScript Promise
is rejected.
new PromiseRejectionEvent(type, { promise: somePromise, reason : someValue });
The PromiseRejectionEvent()
constructor also inherits arguments from Event()
.
type
PromiseRejectionEvent
. This is case-sensitive and must be one of "rejectionhandled"
or "unhandledrejection"
.promise
Promise
which was rejected.reason
Object
which represents the reason the promise was rejected.Specification | Status | Comment |
---|---|---|
WHATWG HTML Living Standard The definition of 'PromiseRejectionEvent()' in that specification. | Living Standard | Initial definition. |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 49 | No support | No support | No support | No support |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | No support | No support | No support | No support | No support |
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent/PromiseRejectionEvent