Cars Report
✓ Published0🌍 Public
This example demonstrates a text-based report of used cars, filtered by price and formatted into a readable list. It shows how asynchronous data retrieval works with a Promise-based `getCars` function that simulates a two-second delay before returning a JSON array of car objects. The `generateReport` module filters cars under a specified maximum price and maps each entry to a string using `formatCar`, which combines year, make, model, and price. The final output is displayed in a `<pre>` element on the page, updated via `document.getElementById` after the promise resolves.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed