The Event Loop is a mechanism that allows JavaScript to perform non-blocking operations by offloading operations to the system kernel whenever possible.
The Event Loop consists of several components including the Call Stack, Web APIs, Callback Queue (Task Queue), and Microtask Queue.
The Event Loop works by continuously checking the call stack and task queues, executing tasks from the queue when the stack is empty.
Promises and MutationObserver callbacks are queued in the Microtask Queue, which has higher priority than the callback queue.