🌍 Public
Viewing a saved revision (read-only)
96a4a1cab6824fc3a87b37abc5d41a75
Cars Report
This example demonstrates a simple text-based report of used cars, filtering a list to show only those priced under $2,000 and formatting each entry as a line with the year, make, model, and price. It relies on JavaScript modules and Promises, with `getCars` simulating an asynchronous API call via `setTimeout` and returning parsed JSON data. The `generateReport` function chains array methods like `filter` and `map`, while `formatCar` handles string interpolation for output. The final result is displayed in a `<pre>` element in the DOM.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.