DEV Community

Mohan Mogi
Mohan Mogi

Posted on

Why javascript is single Threaded

The Origin: Designed for the Browser:
JavaScript was created by Brendan Eich in 1995 to run inside web browsers like Netscape Navigator.At that time, the goal was simple, Make web pages interactive (e.g., form validation, button clicks)To achieve this safely and simply, JavaScript was designed as:
Single-threaded run one task at a time.

Single-Threaded Mean?
Single-threaded is Only one operation runs at a time
No true parallel execution in the main thread.
Example:
console.log("A");
console.log("B");
console.log("C");
Output:
A
B
C

Top comments (0)