1.

What is an event loop?

Answer»

The event loop is the KEY to asynchronous PROGRAMMING in JavaScript. ALTHOUGH JS executes all operations on a single thread, it offers the appearance of multi-threading through the use of a few clever data structures. The call stack is in charge of keeping track of all the actions in the queue that need to be completed. When a function completes, it is REMOVED from the stack. The event queue is in charge of transmitting NEW functions to the track so that they can be processed. It maintains the correct sequence in which all operations should be sent for execution by using the queue data structure.



Discussion

No Comment Found