Cars Report
✓ Published1🌍 Public
This example shows a simple car report generator that fetches a hardcoded JSON dataset of five vehicles, filters them by price under $2,000, and displays the results as formatted text lines. The page initially shows “Loading...” while the code uses a Promise-based `setTimeout` delay in `getCars()` to simulate an asynchronous data fetch. JavaScript modules (`import`/`export`) organize the logic, with `formatCar` handling string interpolation for year, make, model, and price, and `generateReport` chaining `filter()`, `map()`, and `join()` to build the final output into a `<pre>` element.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed