I am a little confused about some terms in the answer of this question: What is the event precedence in JavaScript?
Is there a difference between event loop and task queue and how big are can these queues?
Because when I have set an Interval with setInterval()
and interrupt this with an alert()
then the intervals are dropped for the time where the alert is showing up.
Heap : Stores All variables , Objects , Functions and To all this memory is allocated
Event Queue : He is the person contains list functions TOBE EXCECUTED By Stack.
Stack : He is the main person who EXECUTES FUNCTIONS held by Event queue
Event Loop :
He is the person(manager) who is in contact with Event Queue And Stack.
What he does Is .Ifff The stack is empty and Event Queue Contains Functions to execute.then push the first function from Event Queue to stack
visual Example 1 : latentflip
This is an implementation detail - the specification is saying that an event loop can be use multiple task queues to store events. Presumably there is no practical limit to the size of the queues.
For example, mouse/keyboard events could go into a special INPUT task queue that has a higher priority than other tasks, perhaps to make the UI more reponsive.
alert
will interrupt the processing of events because it is a synchronous operation. Presumably any applicable events would be queued in the meantime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With