Chapter 9 — Classes and Modules
New concepts: class, constructor, methods, inheritance, static
Open the browser Console (F12 → Console) to see output from console.log().
Exercises
- Create an Order class with properties and a formatTotal() method
- Add a static Order.fromCSVLine(line) factory method
- Create a SalesReport class that takes an array of Orders and computes KPIs
- Add a toString() method to Order that returns a formatted summary string