Is JavaScript a Single Threaded Language?

Written by sharjeelsidd | Published 2020/07/11
Tech Story Tags: javascript | asynchronous | callback | eventloop | programming | asynchronous-javascript | async | threads

TLDR JavaScript is a single threaded language that can be non-blocking. Single threaded means it has only one statement executed at a time. Javascript engine runs on a memory heap and a call stack. The call stack job is to fill in the instructions and pop an instruction as it gets executed. When the top of the call stack is run first it pops an instruction and sends it out to the Web API. The most popular is through Multi-threading. This however can run into a problem known as Deadlock, which can be dealt with various deadlock prevention mechanism.via the TL;DR App

no story

Published by HackerNoon on 2020/07/11