How Node and Javascript handle asynchronous functions
Jason Arnold

If it works as you describe and I trust that it does, it should be in the specification and in any introduction to asynchronous calls in Javascript. Perhaps some links to show that this is a well specified behavior, perhaps even mentioned in many introductions, should be added to your story.

Also, you could have included how a loop fits in the call stack? The loop is also finished before any callback. In fact, the entire script is on the call stack, included required files, and the whole thing is executed before the callbacks.

Show your support

Clapping shows how much you appreciated Dominic Mayers’s story.