doA( function1(){
doC();
doD( function2(){
doF();
} )
doE();
} );
doB();
Assuming doA() and doD() to be asynchronous calls we have the sequence: A->B-C->D->E->F
- call A, returns and sends function1 to Queue,
- call B,
- Nothing more to execute -> Executes what's in the Queue -> call C,
- call D, returns and sends function2 to Queue,
- call E,
- 6-Nothing more to execute -> call F.
Is there something actually correct about my reasoning? Am I completely wrong?
This question came from reading "You don't know Javascript" by Kyle Simpson.