JavaScript Async Programming

Test your knowledge of promises,async/await,and callbacks.

1. What is the primary purpose of async/await in JavaScript?
2. What does an async function return by default?
3. Which of the following are valid promise methods?
4. The 'fetch' API returns a promise.
5. Name the function used to schedule a callback to run after a specified delay (full name).
6. Which promise method waits for all input promises to resolve or any to reject?
7. Which of the following are classified as microtasks in the JavaScript event loop?
8. Using 'await' inside a non-async function will throw a syntax error.
9. What happens if a promise is rejected and no rejection handler (catch/finally) is provided?
10. Which of these are valid ways to handle errors in async/await code?
11. The JavaScript event loop is responsible for executing code, collecting and processing events, and handling queued sub-tasks.
12. What is the name of the promise method that waits for all input promises to settle (either resolve or reject)?
13. Which keyword is used to pause execution until a promise is resolved or rejected?
14. Which of the following are asynchronous operations in JavaScript?
15. A promise can exist in one of three states: pending, resolved, and rejected.
Answered 0 of 0 — 0 correct