JavaScript Advanced Tutorial in Hindi #33: Scope Chain in JavaScript in Hindi | Execution Context

preview_player
Показать описание
Welcome, all we will see Scope Chain in JavaScript in Hindi. javascript execution context. Javascript lexical scope explained in one video.
Execution context, Scope chain and JavaScript internals
Execution context (EC) is defined as the environment in which JavaScript code is executed. By environment I mean the value of this, variables, objects, and functions JavaScript code has access to, constitutes it’s environment.
Execution context, Scope chain and JavaScript internals
Execution context (EC) is defined as the environment in which JavaScript code is executed. By environment I mean the value of this, variables, objects, and functions JavaScript code has access to, constitutes its environment.
Global execution context (GEC): This is the default execution context in which JS code start it’s execution when the file first loads in the browser. All the global code are executed inside global execution context. In the browser context, if the code is executing in strict mode value of this is undefined else it is window object. Global execution context cannot be more than one because only one global environment is possible for JS code execution.
JavaScript engine creates the execution context in the following two stages:

Creation phase
Execution phase
Creation phase is the phase in which JS engines has called a function but it’s execution has not started. In the creation phase, JS engine is in the compilation phase and it scans over the function to compile the code.

In creation phase, JS engine performs the following task:

Creates the Activation object or the variable object: Activation object is a special object in JS which contain all the variables, function arguments and inner functions declarations information. As activation object is a special object it does not have the dunder proto property.
Creates the scope chain: Once the activation object gets created, JS 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 global execution context. Scope chain also contains the current function variable object.
Determines the value of this: After the scope chain, JavaScript engine initialize the value of ‘this’.

Execution phase:

In the execution phase, JS engines will again scan through the function to update the variable object with the values of the variables and will execute the code.
javascript lexical scope
Scope Chain:

Scope chain is a list of all the variable objects of functions inside which the current function exists. Scope chain also consists of the current function execution object.

Guys, Please support my channel by SUBSCRIBE to my channel and share my videos in your Social Network TimeLines.

Don't Forget to Follow me on all Social Network,

Рекомендации по теме
Комментарии
Автор

Day 1:- Aaj s aapke channel s advancr javascript padhuga
Thankyou sir ❤️ for the knowledge
God bless you ❤️👑🙏🏼

Knowledgeduniya
Автор

wonderful way of your teaching ...thank you thapa sir

pooja.yadav.
Автор

hey sir i m following u r videos for web development ... i had learn many thing from videos thank u very much

mukadamshaazniyazahmed
Автор

good explanation sir..pls continue other topics too in Javascript

vivekkumar-wodt
Автор

shukriya thapa sir, GOOD LUCK FOR MILLION SUBSCRIBERS!! ;-D

reshmar
Автор

Feedback : video name with part#number shoud be homogeneous :)
no doubt your are awesome that why I'm providing feedback

bajpaimahendra
Автор

thank you very much sir.
it really helps

akshaydayma
Автор

Are bhai sahab isme beech beech me videos gayab hai
32 35

softwareengineerfaizrazaqu
Автор

Sir..pls Continue Other Topics too in Javascript

RohitSinghn
Автор

really awsm you r great totally but one problem is that your sound quality not so clear

Educationwavefree
Автор

can you please make saperate video on JavaScript Debugging including break points

bajpaimahendra
Автор

how can we access inner resources from outer blocks ?? or how can we access from different blocks with different execution context??

subhakantaroul
Автор

Hello bhaiya
Mijhe ek board game banna hai
Jisme every ludo value par div ko move karna hai in computer screen
Bataiye kaise kare

ramchandrapandit
Автор

Is there any group ? Can u please add me

abhijitsen
visit shbcf.ru