Would async bar()
wait for sync foo()
to finish before awaiting the new promise/timeout and calling bar()
again?
function foo() {
console.log('is bar waiting for me to finish?');
}
async function bar() {
foo(); // is this blocking?
await new Promise((r) => setTimeout(r, 10));
await bar();
}
bar();