Cars Report
✓ Published0🌍 Public
This example demonstrates a simple report generator that lists cars under a specified price after a brief loading delay. It shows how JavaScript modules and Promises work together to fetch and filter data, displaying formatted car details in a plain HTML `<pre>` element. The code uses a custom `getCars()` function that returns a Promise resolving to a JSON-parsed array of car objects, and a `generateReport()` function that filters by price and formats each entry using `formatCar`. The report is triggered asynchronously via `getCars().then()`, with the page initially showing “Loading...” before results appear.
AI-generated descriptionAn example tutorial of how to use Javascript objects, array, and modules.
MIT Licensed