Skip to main content
100%

Cars Report

✓ Published1🌍 Public
Ssethips
Last edited Oct 4, 2019
Created on Oct 4, 2019
Forked from Cars Report

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 description

An example tutorial of how to use JavaScript objects, arrays, and modules.

MIT Licensed

Similar vizzes