🌍 Public
Viewing a saved revision (read-only)
a32e6e6a4a7048d88af34f63017489a9
Cars report
This example displays a text-based report of cars, listing each vehicle’s year, make, model, and price. It initially shows “Loading…” while fetching a hardcoded JSON array via a Promise and a simulated 2-second delay, then filters for cars under $2,000 and formats the lines using custom JavaScript modules. The report is rendered into a `<pre>` element, and the code uses `JSON.parse`, `getCars`, `generateReport`, and `formatCar` functions.
AI-generated descriptionAn examples JavaScript in modules