🌍 Public
Viewing a saved revision (read-only)
75813f8a6c5f4233906ac71199dfa29f
Cars Report
This example demonstrates a simple text-based report of used cars filtered by price, displaying each vehicle’s year, make, model, and cost in a preformatted HTML element. It shows how JavaScript modules and Promises structure asynchronous data loading and transformation. The code uses `getCars()` to return a parsed JSON array after a two-second delay, then applies `generateReport` with `filter` and `map` to select cars under $2,000 and format them via `formatCar`. The final output is rendered into the DOM using `document.getElementById` and `textContent`.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.