Create clear module boundaries.
- named exports
- default exports
- dependency graph
Named exports make the public surface of a module explicit. Import only what a consumer needs, and avoid circular dependencies where modules require each other's initialization. A module boundary should group related behavior, not just split a file by line count.
Re-exporting everything from every file hides dependencies and makes changes hard to trace.
Create one module for calculations and another for display, then document each exported function.
Open example.html in a browser and edit example.js. Save, refresh, and use the Console and debugger to inspect values.
- Explain the core idea in your own words without reading the code.
- Change one input and predict the output before running it.
- Test one boundary or failure case, then record what you changed.
Run python3 -m http.server 8000 from the JavaScripts folder, then open this lesson through http://localhost:8000/. Fetch, modules, storage, history, and workers can behave differently or fail under file URLs.