Single threaded programming language simply means that the language can execute only one task at a time.
Let us say there are three functions in our code.
function add (a,b){
console.log(a+b);
}
function subtract (a,b){
console.log(a-b);
}
function multiply(a,b){
console.log(a*b);
}
when all these functions are called like below
add(1,2);
subtract(3,2);
multiply(4,1);
These functions runs on a sequence, first the add function gets executed, then subtract function gets executed and then finally multiply function gets executed.
The add function runs before subtract function and it blocks the execution of subtract function until the execution of add function is completed.
Top comments (3)
You are discussing a code concept of JS, so why not express it like the way it deserve.
There are several topics you should discus...
Either way, great content
Just keep writing :)