Recall & Review
beginner
What is an execution context in JavaScript?
An execution context is the environment where JavaScript code runs. It holds information like variables, functions, and the value of 'this'.
Click to reveal answer
beginner
Name the three main types of execution contexts in JavaScript.
Global execution context, Function execution context, and Eval execution context.
Click to reveal answer
intermediate
What does the 'this' keyword represent inside an execution context?
'this' refers to the object that is currently executing the code in that context.
Click to reveal answer
intermediate
What happens when a function is called in terms of execution context?
A new function execution context is created and pushed onto the call stack to run the function's code.
Click to reveal answer
intermediate
How does the JavaScript engine manage multiple execution contexts?
It uses a call stack to keep track of execution contexts, running the top one and removing it when done.
Click to reveal answer
What is the first execution context created when JavaScript code runs?
✗ Incorrect
The global execution context is created first and represents the outermost environment.
When a function is called, what happens to the execution context?
✗ Incorrect
Each function call creates a new execution context pushed onto the call stack.
Which of these is NOT part of an execution context?
✗ Incorrect
The call stack manages execution contexts but is not part of a single execution context.
What does the 'this' keyword refer to inside a function execution context?
✗ Incorrect
'this' refers to the object that called the function, depending on how the function is called.
What is the role of the call stack in execution contexts?
✗ Incorrect
The call stack tracks which execution context is currently running and manages their order.
Explain what an execution context is and why it is important in JavaScript.
Think about the environment where your code runs.
You got /3 concepts.
Describe how the call stack and execution contexts work together when functions are called.
Imagine stacking plates when you call functions.
You got /3 concepts.