Read full explaination blog on this toping by clicking below

Javascript Execution Context

How Java Script is Executed in backend and How Execution Context is created ?

The Global Context is created ,firtly .

The Global context has two section memory and code . in first code pass memory is allocated for var and function

This in above image is First pass ,var n=10 , var: undefined is created in memory

This in above image is First pass ,var n=10 , var: undefined is created in memory

in second phase , now code is again pass and values assign to the var and function are called

as new function is called then new local execution context is created ,it also pass to call stacked for execution

as new function is called then new local execution context is created ,it also pass to call stacked for execution