Execution context and variable object

preview_player
Показать описание
This execution context object has three properties:
 Variable object
 Scope chain
 The ‘this’ variable

When a function is called, a new execution stack is put on top of the currently executing execution stack. JavaScript engine creates the execution context in the following two stages:
1. Creation Phase
2. Execution Phase

In the creation phase, JavaScript engine performs the following task:
 Creates the Variable object: Variable object is a special object in JavaScript which contain all the variables, function arguments and inner functions declaration information.
 Creates the scope chain: Once the variable object gets created, the JavaScript engine initializes the scope chain which is a list of all the variables objects inside which the current function exists. This also includes the variable object of the global execution context. Scope chain also contains the current function variable object.
 Determines the value of this: After the scope chain, the JavaScript engine initializes the value of this.

In this lecture, we will mainly focus on understanding creation of Variable object property of execution object
Рекомендации по теме
Комментарии
Автор

Great explanation you deserve more views

Gustavo-qkgg
Автор

Great explanation sir. Thanks for the valuable video.

GowthamK-sb
Автор

I'm curious, how would the Variable Object look like inside if you use the same example in your video BUT also add a new function declaration inside difference() function?

How would the new function, let's say "abstraction()", be added to the Variable Object?
Thinking logically, it wouldn't make sense to be added as a property of the Variable Object in the same manner as "difference" as it's not on the same level but inside it?

WeskerUmbrella