Menu

Synchronous vs Asynchronous JavaScript
📰

Synchronous vs Asynchronous JavaScript

DEV Community·Anoop Rajoriya·6 months ago
#bvh06X0n
#why#examples#problems#code#javascript
Reading 0:00
15s threshold

To understand javascript you have to understand its single threaded nature. Imagin a chef in tiny kitchen with only single burner, that burner is the javascript engine and how the chef manage burner heat which determins either restaurant runs smoothly or ends up in a shouting match.

Content List

What synchronous code means

What Asynchronous Code Means

Why JavaScript Needs Asynchronous Behavior

Examples: Timers and API Calls

Problems with Blocking Code

What synchronous code means

Synchronous or sync is the default behaviour of the javascript, its a top to bottom, line by line execution of the code, in that each operaiton must be finish before next one starts.

Call Stack: a stack data structured by the js we called it call stack, it used to keep track what happening.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.