DEV Community šŸ‘©ā€šŸ’»šŸ‘Øā€šŸ’»

DEV Community šŸ‘©ā€šŸ’»šŸ‘Øā€šŸ’» is a community of 963,673 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)

In defense of the modern web

I expect I'll annoy everyone with this post: the anti-JavaScript crusaders, justly aghast at how much of the stuff we slather onto modern websites; the people arguing the web is a broken platform for interactive applications anyway and we should start over;

React users; the old guard with their artisanal JS and hand authored HTML; and Tom MacWright, someone I've admired from afar since I first became aware of his work on Mapbox many years ago. But I guess that's the price of having opinions.