🔰compilation
🚧 施工中
JS ⟩ compile
3 stages of compilation:
code generation: AST -> executable code.
JavaScript code is compiled first, and then execute. (not interpreted line by line)
while scopes are identified during compilation, they're not actually created until runtime (each time a scope needs to run).
compilation
creates a map of all the lexical scopes of the program.
runtime
all the scopes (aka, "lexical environments") and identifiers (variables) for each scope are created at runtime.
Last updated
Was this helpful?