JavaScripture
Contribute via GitHub
Feedback
PromiseRejectionEvent
Instance Properties
promise
Browser API
All API
No API set selected.
PromiseRejectionEvent
:
Event
Event data for when a
Promise
's reject handler is called or an exception is thrown in an Promise executor function or in an async function. See
window.onunhandledrejection
.
Spec
Instance Properties
promise
:
Promise
readonly
The promise that had the unhandled rejection.
Example:
<script> window.onunhandledrejection = function(event) { console.log(event.promise === myPromise); }; var myPromise = new Promise(function(resolve, reject) { reject('Promise reject'); }); </script>
Run
Results:
home
license
contribute
feedback
toggle light/dark mode
Copyright © JavaScripture Contributors