Understanding Event Loop with Microtasks and Macrotasks in JavaScript

If you’ve ever seen JavaScript print values in an unexpected order, you’ve probably run into the event loop.