JavaScript Flashcards
When we run our code, what is created?
The Global Execution Context
The Global Execution Context consists of which two things?
1) Thread of Execution
2) Global Variable Environment or Global Memory
When we execute a function, what is created?
The Local Execution Context or the Function Execution Context
What is the Thread of Execution?
It parses and executes the code line by line
The Local Execution Context consists of which two things?
1) Thread of Execution
2) Variable Environment or Local Memory
What is the Variable Environment?
It is live memory of variables with data in the function
What is the Global Variable Environment?
It is live memory of variables with data
What is the first item on the Call Stack?
The Global Execution Context
When is an item pushed onto the Call Stack?
When a function is called, it is ‘pushed’ on the stack. When it is finished then it is ‘popped’ off the stack.
What is a function parameter?
The name listed in the function’s definition
What is a function argument?
The real value passed into the function
What are the primitive types in JavaScript?
strings, numbers, booleans, undefined, and null
What is stored in the Stack?
Primitives and References because they are fixed size. The size is known at compile time. This is static memory allocation.
What is stored in the Heap?
Objects and Functions. The size is known at runtime. This is dynamic memory allocation.
Do variables point at the Stack or the Heap?
All variables point at the Stack. For objects and functions, the Stack has a reference address to find them in the Heap.
What JavaScript engine does Chrome use?
V8
What JavaScript engine does Node.js use?
V8
What JavaScript engine does Firefox use?
SpiderMonkey
What JavaScript engine does Safari use?
JavaScriptCore
What JavaScript engine does Edge use?
V8, but used to be Chakra
What is an IIFE?
Immediately Invoked Function Expression. It is a self-executing anonymous function.
What is a variable?
It is a named container for storing values
What are variable names called in JS?
Identifiers
What is scope?
Scope defines the lifetime and visibility of a variable.
Scope === Variable Access