Chapter 5 — Functions
New concepts: function declaration, arrow functions, default params, closures
Open the browser Console (F12 → Console) to see output from console.log().
Exercises
- Write classifyOrder(total, status) → 'HIGH-VALUE','STANDARD','CANCELLED'
- Convert to an arrow function — test both give the same result
- Write formatReport(orders, {minTotal=0, status=null}) with defaults
- Write a makeCounter() factory function using closure