I just started learning async-await and just want to know the program execution flow clearly.
async function A() {
await doSomethingAsync();
doThisNext();
}
A();
B();
C();
Given that above code snippet, let's say B() is being executed at the moment.
While B() is executing and if doSomethingAsync() gets resolved right at that moment, will the programing execution suspends B() temporarily to resume A() (ie; start doThisNext() and then switch back?
Or will B() (or even C()) be finished up first and then executes doThisNext()?
Or I am misunderstanding the whole thing?
Assume B and C are just generic functions with no async code.