Event Loop Asynchronous Concepts and JavaScript in the Browser MCQs

Event Loop Asynchronous Concepts and JavaScript in the Browser

1. What is the primary purpose of the event loop in JavaScript?

2. What is the purpose of the call stack in JavaScript?

3. What is the difference between microtasks and macrotasks?

4. What is the purpose of the Promise constructor in JavaScript?

5. What is the main difference between local storage and session storage?

6. How do cookies differ from local storage and session storage in terms of expiration?

7. What is the primary purpose of the Fetch API in JavaScript?

8. What does the Fetch API return upon making a request?

9. How do you handle the fulfilled state of a Promise in JavaScript?

10. When is session storage cleared in a web browser?

11. In the event loop, where does a setTimeout callback go after the delay has elapsed?

12. Where do Promises get placed in the event loop when they are resolved?

13. How can you handle a rejected Promise in JavaScript?

14. What is a key difference between session storage and local storage?

15. What does the 'await' keyword do in an async function?

16. What type of object does the Fetch API return?

17. How can you handle a Fetch API response in JavaScript?

18. How can you parse JSON data from a Fetch API response?

19. Which storage method can be accessed by both client and server?

20. Which of the following is processed after the microtask queue?

Post a Comment

Your comment will be visible after approval.
© TechTestLog. All rights reserved. Premium By Raushan Design
//My script