Javascript – Why does "throw Error" make a function run as synchronous?
I was writing some code and found something interesting. Example 1: async function load(closure) { try { await closure(); } catch (error) { console.log("error"); } finally { console.log("finished"); } } load(async () => { throw new Error(); }); console.log("hello"); This…