Chhakuli Zingare
Software Engineer At Oraczen
Simple good start up article for javascript developer
I have understood the generals of this for quite a while, but could not explain it. Now I better can!
I wonder if this is why you cannot use a while loop to block the thread while waiting for an asynchronous task to be completed. The browser delegates that task to another thread, and when that promise is resolved, it will place the response/callback in the event queue. However, if a while loop is ongoing (like while (true)) then it will keep iterating forever, placing its iterations into the call stack continuously.
Thus, the call stack will never be empty for the promise in the event loop to reach the call stack and proceed with the code.
Is my thought process correct here?
This is worth reading🚀🚀.
But there is also another type of queue along with Event Queue Microtask queue / Priority queue.
You're nailed it down the event loops and the best explanation. While I'm reading your articles, those articles are directly transferred to my brain. keep write and never give up. You're text animations also awesome!
Santosh more
keep writing