So I am an undergrad student studying Javascript from none other than Akshay Saini and there are some concepts that I got to know are very much important to learn for a better understanding of our javascript language.
Starting with the first concept
What is an Execution Context?
So an Execution Context is a container inside which the whole JS runs. It stores the information on the environment of the code that is to be executed.
It is divided into 2 parts - The memory Component, Code Component.
->The Memory component stores the value of variables and functions that are present in the code it stores in value key pairs
-> The Code component is the section where the code is being executed line by line because we know that Javascript is a synchronous language and it is also single-threaded.
How does Javascript work?
When a Javascript code is run, then a Global Execution Context is created and it has two parts as mentioned earlier the Memory Component stores the value of the variables and functions present in the code and then the code component checks every line of the code at a time.
In Javascript when a function is being called a new Execution context is created which again stores the values present in the function code inside the memory component then the code component is run and after the function is executed the execution context that was created for the function gets deleted totally from the global execution context and after the whole set of codes gets to run the global execution context is deleted.