why promise has a weird precedence for errors in js?
Advertisements I have the code below and I expect to first have hi in my console then the error and at the end why, but the result is: hi, then why and the last one is error, so I’m wondering, why is this happening? code: const test = new Promise((resolve, reject) => { console.log("hi"); throw… Read More why promise has a weird precedence for errors in js?