Node.js event loop, better explained.

There are many versions of event loop tutorials that you can find around the web. At least for me, most of them are confusing or logically doesn't make any sense.

I find Bert Belder's keynote on event loop easy to understand. It makes sense on how JavaScript returns you the results at different intervals when performing various operations. I can clearly understand the differences between setTimeout() setInterval(), process.nextTick() and setImmediate(). Without further ado,

Why I am writing this post?

  1. JavaScript execution patterns are difficult to understand for anyone transitioning from a type based languages. And this keynote may help them rewire their brains!
  2. JavaScript backend developers may have asked to explain Node.js event loop probably on every single interview he/she may have attended. They can prepare confidently from this keynote.
  3. For interviewers who think they know Node.js event loop but don't.
  4. For myself so whenever I forget, I can come and refer my post.

At the time of writing this post, shockingly only 44k people have viewed this wonderful keynote. I'm sure there are more than 44k Node.js developers in the world! 😒