Execution context and execution stack

Publié le: 01 novembre 2020
sur la chaîne: procademy
2,317
75

So far, we have a conceptual overview of what happens in the JavaScript engine once we run our JavaScript code and how it is parsed and translated into machine code. Now, let’s understand the order in which the code runs.

All JavaScript code needs to run in an environment and these environments are called execution context. You can imagine an execution context like a box or a container which store variables and in which a piece of JavaScript code is evaluated and executed.

That means, for each function, when it is executed, a box will be created for that function and the variables, this keyword and method parameters will be stored and executed inside that box.

The default execution context is always the global context. This global context contains all the code which is not inside any function for example, global variables and functions. You can consider the global context as an object. Therefore, the global context is associated with the global object which in case of browsers is the window object.

Let's understand execution context and execution stack in great detail in this lecture.


Sur cette page du site, vous pouvez voir la vidéo en ligne Execution context and execution stack durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur procademy 01 novembre 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 2,317 fois et il a aimé 75 téléspectateurs. Bon visionnage!