How does the event loop work in JavaScript?

Technical