Modern JavaScript & Modules
Organise real applications with ES modules, closures, classes, error handling, and a practical debugging workflow.
Functions, objects, DOM basics, and the ability to debug a browser script.
Split an application into ES modules, encapsulate state with closures and classes, handle errors deliberately, and debug stack traces.
Read in order, or jump to what you need.
Every lesson builds on the one before it. Open any lesson to read the explanation, run the examples, and try the practice challenges.
- 06.01ES Modules: Import & Export4 min
Split code into focused files, share only what is needed, and load optional features on demand.
- 06.02Closures & Encapsulation4 min
Use lexical scope to keep state private, build small utilities, and recognise when a closure costs more than it gives.
- 06.03this, Classes & Composition4 min
Predict what this refers to, use bind and arrow functions deliberately, and design objects with classes or composition.
- 06.04Error Handling & Debugging4 min
Throw meaningful errors, handle only what you can recover from, and use browser tools to find the real cause.
- 06.05Project: Modular Quiz AppProject4 min
Build a quiz from three focused modules: a question bank, a validated engine, and an accessible DOM interface.
Ready to move on?
Deliver a modular quiz app whose data, engine, and UI live in separate files and whose invalid input is handled without crashing.
Open the module self-check