DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 966,904 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cover image for Summarizing Namaste
πŸ™ JavaScript EP01 (Execution Context)
Abhinav Singh Jamwal
Abhinav Singh Jamwal

Posted on

Summarizing Namaste πŸ™ JavaScript EP01 (Execution Context)

Thank you Akshay Saini for this beautiful series. Just summarizing your lessons for whenever I need a quick recap. Same for others. Hope it helps.

"Everything in Js happens inside an Execution Context"

What is an execution context ??

We can say execution context is like a container in which whole Js runs.

Execution context consists of two parts:

1->Memory or Variable environment
2->Code or Thread of execution

Js is not possible without execution context.

image

In first part, all the variables and functions are stored here as key value pair. When I say functions it means whole function code is assigned as a value.

In second part, all the Js code is executed line by line.

Js is a synchronous single threaded language.

To understand this, single thread means Js can execute one command at a time.
So, synchronous single threaded means it will execute code one at a time and cannot move forward(next line of code) without finishing previous one.

Top comments (0)

This post blew up on DEV in 2020:

js visualized

πŸš€βš™οΈ JavaScript Visualized: the JavaScript Engine

As JavaScript devs, we usually don't have to deal with compilers ourselves. However, it's definitely good to know the basics of the JavaScript engine and see how it handles our human-friendly JS code, and turns it into something machines understand! πŸ₯³

Happy coding!