1/14
A set of flashcards summarizing key concepts from the Namaste JavaScript lecture series on execution context, hoisting, closures, and asynchronous programming.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is Execution Context in JavaScript?
An abstract concept that holds information about the environment within the current code being executed.
What are the two components of Execution Context?
Memory Component (also called Variable Environment) and Code Component (also called Thread of Execution).
What does the Call Stack do?
It keeps track of the order of execution of execution contexts.
What is Hoisting in JavaScript?
Hoisting is a feature where variables and function declarations are moved to the top of their containing scope during the compile phase.
What signifies 'undefined' in JavaScript?
It signifies that a variable has been declared but has not yet been assigned a value.
What is a Closure in JavaScript?
A closure is a function bundled with its lexical scope that captures variables from its outer function even after the outer function has returned.
What are Higher Order Functions?
Functions that take other functions as arguments or return functions as their results.
What is the Temporal Dead Zone?
The time from when a variable is hoisted until it is initialized, during which the variable cannot be accessed.
What is Block Scope in JavaScript?
Block scope refers to the area within curly braces {}, where variables declared with 'let' and 'const' are limited to.
Explain the difference between 'undefined' and 'not defined'.
'Undefined' is when a declared variable has not yet been assigned a value; 'Not defined' indicates that a variable has not been declared at all.
What is the purpose of the '.map()' method in JavaScript?
It creates a new array with the results of calling a function on every element in the original array.
What does the '.reduce()' method do?
It reduces an array to a single value by executing a provided function for each element.
What is the significance of using 'let' and 'const' in JavaScript?
Both are block-scoped declarations; 'let' allows for variable reassignment, whereas 'const' does not allow reassignment.
How does the Event Loop work in JavaScript?
It checks the callback queue and moves callbacks from there into the call stack for execution when the call stack is empty.
What triggers Memory Leak in JavaScript?
When closures are used excessively, holding on to callbacks and preventing variables from being garbage collected.