Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 807 Bytes

File metadata and controls

10 lines (7 loc) · 807 Bytes
title subtitle
What is event loop?
What is the difference between call stack and task queue?

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".