Cars Report
✓ Published1🌍 Public
This example demonstrates how to fetch and display a text report of used cars priced under $2,000. The page initially shows “Loading...” while a promise-based `getCars()` function simulates a two-second delay before resolving with a hardcoded JSON array. The `generateReport` function filters that array and applies `formatCar` to produce a formatted list with year, make, model, and price. It uses JavaScript ES6 modules, destructuring, `JSON.parse`, and `Promise` with `setTimeout` to mimic asynchronous data retrieval.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed