Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The ECMAScript execution context specification is made up of several components that explain its state. These components are:

  1. Variable environment: It contains the scope chain and all the variables declared in the current scope.

  2. Lexical environment: It is similar to the variable environment, but it also contains any variables declared in the outer scope.

  3. This binding: It is the value of the "this" keyword, which is determined at runtime depending on how the function was called.

  4. Lexical this binding: Similar to the "this" binding, but it refers to the value of "this" in the outer lexical scope.

  5. Code evaluation state: It is used to keep track of the state of the code being executed, such as whether it is currently running or paused.

  6. Function stack: It keeps track of the order in which functions are called and their execution contexts.

  7. Closure: A closure is created when a function is declared inside another function, and it allows the inner function to access variables in the outer function's scope even after the outer function has returned.