Chapter 8 — fetch() and APIs
New concepts: fetch, async/await, Promise, JSON, error handling
Open the browser Console (F12 → Console) to see output from console.log().
Exercises
- fetch('data/sales.json') and render the first 10 orders in a table
- Add error handling with try/catch — test with a wrong URL
- fetch employees.json and products.json in parallel with Promise.all()
- Build a loading spinner shown while fetch is running, hidden on complete