JavaScript Tutorial Part 2 - Execution Context and The Call Stack

Published: 09 November 2018
on channel: Ghost Together
6,476
241

JavaScript Tutorial For Beginners

Learning Curve Books: http://www.learningcurvebook.net
Follow on Twitter:   / js_tut  
Instagram:   / javascriptteacher  
Facebook:   / javascriptteacher  

Execution Context and the Call Stack in JavaScript are explained in this relatively trivial tutorial. First, recognize that the global scope is nothing more than an instance of the main Window() object. The "this" keyword, and variable environment are used to juggle around data inside the lexical environment of a particular scope.

Basically, every time a function is called, a new execution context is created. An execution context is composed from the Lexical Environment of the scope it is in, the Variable Environment and "this" keyword binding. The this keyword will refer to the object, of the scope from which the function was called. However, when an object literal is used, or the function is used to instantiate a new object using the "new" operator, then the function will create its own this / execution context. You can chain execution contexts, as they are placed on the main Call Stack. When the function returns, the execution context is removed from the top of the Call Stack.

Self-education + Computer Literacy
For next generation of teachers,
artists, coders, designers, and makers of things:
Learning Curve Books: http://www.learningcurvebook.net


On this page of the site you can watch the video online JavaScript Tutorial Part 2 - Execution Context and The Call Stack with a duration of hours minute second in good quality, which was uploaded by the user Ghost Together 09 November 2018, share the link with friends and acquaintances, this video has already been watched 6,476 times on youtube and it was liked by 241 viewers. Enjoy your viewing!