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.

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

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

Okay