In the book “Scope and Closure” there is this paragraph:
Let’s meet the cast of characters that interact to process the program var a = 2;, so we understand their conversations that we’ll listen in on shortly:
- Compiler: one of Engine’s friends; handles all the dirty work of parsing and code-generation (see previous section).
- Scope: another friend of Engine; collects and maintains a look-up list of all the declared identifiers (variables), and enforces a strict set of rules as to how these are accessible to currently executing code.
- You write your code in the compiler.
- You let your compiler compile your code, a.k.a turn it into machine code.
- Then you hit run.
As the example gave out above, I have a few questions to ask:
- What is engine? Like chrome V8 engine? And is this engine in the cloud?? Or it is on your local machine, inside of chrome browser.
- Scope, is this scope of “global scope” and “local scope”?
Am I understanding these correctly?