Execution context

  1. What actually is an Execution Context ?

Execution context is the concept for describing the internal working of a code. In JavaScript, the environment that enables the JavaScript code to get executed is what we call JavaScript Execution Context. It is the execution context that decides which code section has access to the functions, variables, and objects used in the code. During the execution context, the specific code gets parsed line by line then the variables and functions are stored in the memory. An execution context is similar to a container that stores variables, and the code gets evaluated and then executed. Thus, it is the execution context that provides an environment for the specific code to get executed.

Types of Execution Context

The types of execution context in JavaScript are:

  • Global Execution Context/GEC
  • Functional Execution Context/FEC
  • Eval Execution Context