DEV Community

Cover image for How JavaScript Works?
Sadiq Shah
Sadiq Shah

Posted on

How JavaScript Works?

Working on the JavaScript is good but should also know the execution of the JavaScript.

Image description

So let discussed How JavaScript works?

  • JavaScript works on browser with the help of execution context means the execution context is the box where your all java scripts are render.

But there are two components

  • Memory Component (Variable Environment)
  • Code Component (Thread of Execution)

memory and code are linked together because code are stored into memory then execute.

Memory Component:

It is stored all variable and function as key paired value.
Example:
{
a = "sadiq"
function : sum(n,a)
}

Code Component:

In code component your all code render line by line or run 1 line at a time and also know as thread of execution.

JavaScript is synchronous single threading language.

Single Threading : Run one line of code at a time.
Synchronous Single Threading : Run one line of code at a time with

That Why JavaScript know as Synchronous Scripting Language .
specific order.

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

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

Okay