Photo by Clément Hélardot on Unsplash

Note: JavaScript is synchronous and single-threaded language, which means that it executes one command at a time in a certain order.

1. Execution of a JavaScript program

Whenever a JavaScript program is run an Execution Context (EC) is created (visualize it as a container), it contains 2 components:
1. Variable Environment (Memory): consists of key-value pairs (variable: value)
2. Thread of Execution (Code): in this, the code execution takes place.

Let us walk through the execution of a simple code:

Mitali Sonawane

Interested in web-app development and cloud computing domains

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store