DEV Community

Cover image for How Javascript Works and Execution Context?
Lawaanu Borthakur
Lawaanu Borthakur

Posted on • Edited on

How Javascript Works and Execution Context?

Everything in Javascript happens inside an execution context.
Execution Context is a container where whole javascript code is executed.
Execution Context has two components:
1)Memory Component 2)Code Component
Memory Component is also known as Variable Environment
Code Component is also known as Thread of Execution
Execution Context Diagram
⭐In Memory component all the variables and functions are stored
as a key-value pairs.**
⭐In Code Component code are executed one line at a time.

Note:Javascript is a Synchronous single Threaded Language
*Synchronous means in order.
*Single Threaded means one command processes at a time.

Reference:@akshaymarch7

Top comments (0)