Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <title>Title of the document</title> <head></head> <body> <script> let promise = Promise.reject(new Error("Promise failed")); setTimeout(() => promise.catch(err => alert('caught')), 1000); // Error: Promise failed window.addEventListener('unhandledrejection', event => alert(event.reason)); </script> </body> </html>