The Event Loop takes the timer with the shortest wait time and compares it with the Event Loop’s current time . If the wait time has elapsed, then the timer’s callback is queued to be called once the call stack is empty. Node. js has different types of timers: setTimeout() and setInterval() .
Read moreHow does JavaScript event loop work?
The Event Loop has one simple job — to monitor the Call Stack and the Callback Queue . If the Call Stack is empty, the Event Loop will take the first event from the queue and will push it to the Call Stack, which effectively runs it. Such an iteration is called a tick in the Event Loop.
Read more