JavaScript - behind the scenes clockwork

Hi good people.

When we write a JavaScript script the engine processes the code in a certain fashion. I want to know if any of you know how to find that info, or know the order which it processes it.

For example:

function foo() ... var bar ... foo(); .... does the engine creates the var's first, and then the function signature, and then body, what about function call, or object call? I just want to know the order. Thanks

Hi, @edfimasa. If I understood that part in YDKJS (a six-book series) correctly, all function declarations are hoisted at the topmost part of the code. Then all variable declarations follow.