Now, what's execution context?
You can assume it be a container where your whole code is executed.
Execution context has two components in it:
- Memory Component (Variable Environment)
- Code Component (Thread of Execution)
Now let's understand the role of each component in the execution context.
The first component, the memory component which is also known as the variable environment is responsible for storing all the variables and functions as key value pair. Long story short, it's sort of an environment which is used to store all the variables and functions as key : value pair.
The second component, the code component which is also known as the thread of execution is responsible for executing the code one line at once. It's called the thread of execution because it's like a thread in which the whole code is executed one line at a time.