Test 6
Completion requirements
Due: Monday, 16 May 2022, 12:00 AM
The image below represents what happens when the setTimeOut() command is called. In this case, the event generated is the time is up and it will add a new function call to the callback queue. An event can be a mouse click, a key down, etc.
Choose one question:
- Explain how the callback queue and event loop process an event?
- JavaScript UI has only one execution thread. What happens if an event is fired when JavaScript is in the middle of a function call?
- Explain how the callback queue and event loop process an event?
- Why, when an event is fired, its callback function goes to a queue? Why it isn't called immediately?