What is an event loop in JavaScript?

The event loop manages async tasks by dequeuing tasks when the call stack is empty.

Example: The event loop enables setTimeout to execute later even in synchronous code.