Execution context and Call Stack

Опубликовано: 23 Май 2021
на канале: procademy
6,530
149

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 JavaScript code is executed.

We have learned that JavaScript code is executed inside JavaScript engine’s call stack. A call stack consists of execution contexts. So, what is execution context?

What is Execution Context?
Execution context is an abstract concept. But we can say that an execution context is an environment inside which a piece of JavaScript code gets executed. It’s like a box or a container that stores all the necessary information like local variables, arguments etc. for a piece of code to be executed.