Medium
Understanding JavaScript Event Loop: Order of Execution with Promises and setTimeout
What will this code output and why?
1setTimeout(() => console.log("First"), 0);2Promise.resolve().then(() => console.log("Second"));3console.log("Third");
What will this code output and why?
1setTimeout(() => console.log("First"), 0);2Promise.resolve().then(() => console.log("Second"));3console.log("Third");