Module 11 · Modules: import, export and How Files Find Each Other
When to Use Which: Default or Named, a Module or a Class, ES Modules or CommonJS
Free with an accountReading
Maria's team opens a new project and argues for an hour. One developer wants a default export in every file. Another wants named exports only. A third asks why the cart is a module and not a class. Nobody is wrong about everything, so the argument never ends.
Checking what this lesson needs for you…
What is inside When to Use Which: Default or Named, a Module or a Class, ES Modules or CommonJS
- Named exports by default
- When a default export earns its place
- The style guides that disagree
- A module, a class, or a closure
- ES modules or CommonJS for new code
- Mixing the two, safely
- When not to split a file
- The whole decision in one table