Function is The Heart Of JavaScript
Everything in JavaScript Happens Inside an Execution Context
All JavaScript code runs within an execution context, which provides an environment for the code execution. When JavaScript code runs, it first creates a Global Execution Context (GEC). The GEC ( Global Execution Context ) Put Into The Call Stack .
What is Call Stack In JavaScript ?
The call stack in JavaScript is a mechanism that helps the JavaScript engine keep track of function calls and their execution order. It follows the Last In, First Out (LIFO) principle, meaning that the last function called is the first one to complete execution and be removed from the stack.
It Has two main components:
- Memory Component (Variable Environment)
- Code Component (Thread of Execution)
Top comments (0)