DEV Community

Cover image for Day 156: Hello Event loop...
Ivad Yves HABIMANA
Ivad Yves HABIMANA

Posted on

Day 156: Hello Event loop...

Hi!
Yesterday was a good one! I spent it mostly going through JavaScript specifically learning about Event loop which is a crucial part of having asynchronous behaviour in JavaScript which by design is a synchronous single-threaded language.

Generally, JavaScript runs everything one line at a time and every line has to wait for the previous one to complete before it runs but this is not the case in the real-world application as we often want to run multiple things at the same time or don't want to block the program while we wait for this one thing to finish to run

This where asynchronous code and event loop comes into the picture where blocking code is put in the callback queue and the job of the event loop is to moderate the callback/task queue and the program call stack so that blocking code will be able to run when their time comes without blocking the rest of the program

whew! this was not clear enough I know, still much to cover to understand fully how the event loop works in the JavaScript runtime environment. I am preparing a more in-depth blog that will explain more about the topic maybe sometime this week

In the meantime, I am trying to get back in the flow of writing and keep consistency as in the good old days

Signing off for now...

Top comments (1)

Collapse
 
adeodatus profile image
Adeodatus Abdul

Thanks for sharing Yves.