How does the engine work

This is my general understanding of how JavaScript compilation works (without regard to optimizations) so far:

Lexical scope

We focus on the rules of lexical scope, including var/let distinctions, promotions, closures, etc

This is the end of the JavaScript lexical section.