Enjoy 20% off all plans by following us on social media. Check out other promotions!
Quiz Questions

What is event loop?

What is the difference between call stack and task queue?
Topics
JAVASCRIPT
Edit on GitHub

The event loop is a single-threaded loop that monitors the call stack and checks if there is any work to be done in the task queue. If the call stack is empty and there are callback functions in the task queue, a function is dequeued and pushed onto the call stack to be executed.

If you haven't already checked out Philip Robert's talk on the Event Loop, you should. It is one of the most viewed videos on JavaScript.

For a visual demonstration of the event loop, accounting for different types of tasks, check out Jake Archibald's talk titled "In The Loop".

Edit on GitHub