Please tell me why in this code:
function print() {
console.log("1");
}
console.log("2");
async function foo() {
console.log("3");
await print();
console.log("4");
}
foo();
console.log(5);
Output is: 2 3 1 5 4
But not: 2 3 1 4 5
What’s reason?
see above
I expected that result : But not: 2 3 1 4 5
But Output is: 2 3 1 5 4