Cars Report
✓ Published0🌍 Public
This example demonstrates how to generate a text-based car report, filtering a hardcoded JSON dataset of five vehicles by price and formatting each entry as a single line with year, make, model, and cost. It shows an asynchronous loading state before displaying the final report in a large `<pre>` element. The code uses ES6 modules, `JSON.parse`, a `Promise` with `setTimeout` to simulate a data fetch, and `Array.filter` combined with `Array.map` and `join` via exported functions `getCars`, `formatCar`, and `generateReport`.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed