Modules in JavaScript MCQs

Modules in JavaScript

1. What is the purpose of the 'export' keyword in ES6 modules?

2. What does the 'import' keyword do in ES6 modules?

3. What is the main difference between CommonJS and ES6 modules?

4. What is a default export in ES6 modules?

5. What are named exports in ES6 modules?

6. How do ES6 modules differ from CommonJS modules in terms of loading?

7. Can you have both named exports and a default export in the same module?

8. What can happen with circular dependencies in ES6 modules?

9. How do you import a default export in ES6 modules?

10. How do you import named exports from a module?

11. How can you load ES6 modules in your JavaScript code?

12. What is a module in JavaScript?

13. How do you define a default export in an ES6 module?

14. Why are named exports called 'named' exports?

15. What does the export * from 'module' syntax do?

16. Why are modules important in JavaScript?

17. What file extension do ES6 modules typically use?

18. How can you include an ES6 module in an HTML file?

19. Why might developers use a bundler with ES6 modules?

20. What does the .mjs file extension signify?

Post a Comment

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