

It stores the variables and function declarations defined within that Execution Context. The Variable Object (VO) is an object-like container created within an Execution Context. Creation Phase: Creation Of The Variable Object (VO) The creation phase occurs in 3 stages, during which the properties of the Execution Context Object are defined and set.
#Javascript execution interrupted robo 3t code#
The Execution Context Object stores a lot of important data which the code in the Execution Context uses during its run-time. In the creation phase, the Execution Context is first associated with an Execution Context Object (ECO). The creation of an Execution Context (GEC or FEC) happens in two phases: Now that we are aware of what Execution Contexts are, and the different types available, let's look at how the are created. Since every function call gets its own FEC, there can be more than one FEC in the run-time of a script. Whenever a function is called, the JavaScript engine creates a different type of Execution Context known as a Function Execution Context (FEC) within the GEC to evaluate and execute the code within that function. For every JavaScript file, there can only be one GEC. The GEC is the base/default Execution Context where all JavaScript code that is not inside of a function gets executed. Whenever the JavaScript engine receives a script file, it first creates a default Execution Context known as the Global Execution Context (GEC). There are two kinds of Execution Context in JavaScript: The Execution Context contains the code that's currently running, and everything that aids in its execution.ĭuring the Execution Context run-time, the specific code gets parsed by a parser, the variables and functions are stored in memory, executable byte-code gets generated, and the code gets executed. This environment is known as the Execution Context. The browser's JavaScript engine then creates a special environment to handle the transformation and execution of this JavaScript code.

While reading through HTML, if the browser encounters JavaScript code to run via a tag or an attribute that contains JavaScript code like onClick, it sends it to its JavaScript engine. It needs to be converted into a format that the browser and our computers can understand – machine code. How JavaScript Code Gets Executedįor does who don't know, the browser doesn't natively understand the high-level JavaScript code that we write in our applications. Now, that we've gotten those out of the way, let's dive in.
