High Level Concepts Flashcards
First Class Functions
Functions are treated as variables
Single Threaded
One command is processed at a time
Event loop
Takes long running tasks, executes them in the background, and puts them back in the main thread once they are completed
Compilation
Entire codebase is converted into machine code at once, and written to a binary file that can be executed by a computer
Interpretation
Interpreter runs through the source code and executes it line by line
Just-in-time Compilation
Entire code is converted into machine code at once, then executed immediately
Web API’s
Functionalities provided to the engine, available on the window object. DOM, Times, Fetch…
Top-level code
All code outside of functions
Global Execution Context
Default execution context stated when a file is loaded in the browser. All top-level code is executed here
Execution context
The environment in which the javascript code is executed
Call Stack
Place where execution contexts get stacked on top of each other, to keep track of where we are in the execution
What Makes Up An Execution Context
- Variable environment
- Scope Chain
- “this” keyword
Lexical Scoping
Defines how variable names are resolved in nested functions
Scope
The accessibility or visibility of variables
3 Types of Scope
Global, function and block