When I am running below code in the console, I am getting output as:
"start"
"Promise 2"
"end"
"Promise 1"
console.log("start");
Promise.resolve().then(
() => console.log("Promise 1")
).then(console.log("Promise 2"));
console.log("end");
Can anyone explain to me why "Promise 2" is printed before "Promise 1" and "end"?