JS is Single Threaded

JS acts anchronously whenever we use callback functions

as the callbacks are handled by the browser and browser works on C++ which is multi-threaded.


 // ASYNCHRONOUS NATURE OF JS


setTimeout(()=>{console.log("Abhiii");},2000);
setTimeout(()=>{console.log("Helloo world");},2000);
console.log("Hellooo");



Comments

Popular posts from this blog

Callback Hell

TODO list with DOM

Refactoring callback hell code