Asynchronous and Synchronous

Hydroid
1 min readMay 8, 2019

What is Synchronous and Asynchronous Execution?

JavaScript is synchronous, blocking, single-threaded language. That means that only one operation can be in progress at a time.

Synchronous :

Say we have 2 lines of code. Synchronous means Line-2 can not start running until the Line-1 has finished executing.

The JS Engine reads our code line by line, it uses Single Call Stack to keep track of codes that are supposed to run in their respective order. Like a stack, in a data structure that works in LIFO(Last-In-First-Out) manner.

Originally published at https://techthriver.wordpress.com on May 8, 2019.

--

--

Hydroid

Currently working as a Full Stack Developer in India