Question 5 of 5Pro Only

What are JavaScript modules, and what is the difference between named exports and default exports?

Sample answer preview

JavaScript modules are a way to split code into separate files, each with its own scope. Modules help organize code, avoid global namespace pollution, and enable code reuse. Each file is a module with its own scope. Variables and functions are private by default.

importexportdefault exportnamed exportES modulesCommonJS

Unlock the full answer

Get the complete model answer, key points, common pitfalls, and access to 4+ more Frontend Developer interview questions.

Upgrade to Pro

Starting at $19/month • Cancel anytime