0
0
Javascriptprogramming~5 mins

What execution context is in Javascript - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AEval execution context
BFunction execution context
CBlock execution context
DGlobal execution context
When a function is called, what happens to the execution context?
AThe global context is replaced
BThe function runs without any execution context
CA new execution context is created and added to the call stack
DThe previous context is deleted
Which of these is NOT part of an execution context?
ACall stack
BLexical environment
C'this' binding
DVariable environment
What does the 'this' keyword refer to inside a function execution context?
AThe object that called the function
BThe global object always
CThe function itself
DUndefined
What is the role of the call stack in execution contexts?
ATo store variables
BTo keep track of execution contexts in order
CTo execute code asynchronously
DTo manage memory allocation
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.