DEV Community

Laxman Nemane
Laxman Nemane

Posted on

3

Execution Context in JavaScript (second part)

What is Execution Context?
Execution context is the environment in which JavaScript code runs. It contains information about variables, functions, and the value of this.

Types of Execution Context:

1. Global Execution Context:
This is the default context where your JavaScript code runs initially. It creates a global object (like a window in browsers) and allows access to global variables and functions.

2. Function Execution Context:
Created whenever a function is called. It holds the function's parameters, local variables, and values. Each function call has its context.

3. Eval Execution Context:
We created when using the eval() function to execute code represented as a string.

Execution Context Stack :
JavaScript uses a stack to manage execution contexts. When a function is called, its context is pushed onto the stack. When it finishes, the context is popped off.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Cloudinary image

Optimize, customize, deliver, manage and analyze your images.

Remove background in all your web images at the same time, use outpainting to expand images with matching content, remove objects via open-set object detection and fill, recolor, crop, resize... Discover these and hundreds more ways to manage your web images and videos on a scale.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay