In JavaScript Understanding the Weird Parts ,the genesis of a particular execution context was explained in reference to two phases:
- Creation phase - declarations are prioritized and initialized with undefined values
- Execution phase - where assignments are resolved
In this answer to a related question, the author refers to the interpreter making two passes on the source code.
Has this always been a feature of JS or is it more recent phenomenon related to more modern JS engines which act as JIT compilers?