Javascript – Promises and order of execution
I'm confused about the execution order of the following code (Ran on jsfiddle): let num = 10; window.addEventListener("unhandledrejection", (event) => { num = 20 }); let promise = new Promise((resolve, reject) => { reject("reject"); }); setTimeout(() => { promise.catch(() =>…