Event Loop and Asynchronous JavaScript

Understand how promises,async/await,and the event loop work.

1. What is the primary role of the Event Loop in JavaScript?
2. Which of the following is classified as a microtask?
3. The Event Loop is responsible for moving callbacks from the task queue to the call stack when the call stack is empty.
4. What term refers to a function passed as an argument to another function to be executed later?
5. Select all examples of macrotasks.
6. After the call stack is empty, which type of task is executed first by the Event Loop?
7. Async/await syntax is syntactic sugar built on top of Promises.
8. What keyword is used to pause execution of an async function until a Promise is resolved, returning its result?
9. Which statements about the JavaScript call stack are true?
10. What occurs when a Promise is rejected but no .catch() handler is provided?
11. Microtasks are executed after all macrotasks in each iteration of the Event Loop.
12. Name the JavaScript engine used in Google Chrome and Node.js (full name).
13. Which of the following are sources of microtasks?
14. What is the effect of prefixing a function with the 'async' keyword?
15. The Event Loop is defined in the ECMAScript specification (JavaScript language standard).
16. What is the default delay (in milliseconds) for setTimeout when no delay is specified?
17. Which of the following operations can block the Event Loop?
18. In the following code, what order will the console logs appear? `console.log('A'); setTimeout(() => console.log('B'), 0); Promise.resolve().then(() => console.log('C'));`
19. Microtasks are processed in the order they are added to the microtask queue (FIFO: First In, First Out).
20. What term describes a single iteration of the Event Loop, where it processes all microtasks and one macrotask?
Answered 0 of 0 — 0 correct