In the following code:
function doStuffA() {
// DO SOME THINGS
doStuffB();
// DO SOME MORE THINGS
}
function doStuffB() {
// DO B THINGS
}
doStuffA();
What order is the code executed?
Is it:
1. DO SOME THINGS
2. DO B THINGS
3. DO SOME MORE THINGS
Or:
1. DO SOME THINGS
2. DO B THINGS & DO SOME MORE THINGS - AT THE SAME TIME
Assuming you intended for there to be a call to
doStuffBindoStuffA, and a call todoStuffAsomewhere…Javascript is traditionally executed synchronously.
Therefore: