JavaScript Asynchronous Programming

Test your knowledge of promises,async/await,and the event loop.

1. Which of the following is NOT a state of a JavaScript Promise?
2. Which of the following are asynchronous operations in JavaScript?
3. The 'await' keyword can only be used inside an async function.
4. What does the acronym 'API' stand for in the context of web requests?
5. What is the output order of: console.log(1); setTimeout(() => console.log(2), 0); console.log(3);
6. Which of the following are classified as microtasks in JavaScript?
7. An async function always returns a Promise.
8. Which method is used to explicitly handle a rejected Promise?
9. Name the mechanism that manages the execution order of asynchronous code in JavaScript.
10. Which of the following functions return a Promise?
11. What is the result of 'await Promise.resolve(5);'?
12. Microtasks are executed before the next macrotask in the event loop.
13. What keyword is used to declare an asynchronous function in JavaScript?
14. Which method runs multiple Promises in parallel and resolves only when all have resolved?
15. How can errors be handled in async/await code?
16. setTimeout with a delay of 0ms executes immediately after the current line of code.
17. What is the return value of an async function with no explicit return statement?
18. Which of the following are examples of macrotasks?
19. Promise.race() resolves or rejects as soon as any of its input Promises settles.
20. What does 'AJAX' stand for, a technique for asynchronous web requests?
Answered 0 of 0 — 0 correct