🌍 Public
Viewing a saved revision (read-only)
025a354c8cf24b92925b5531641ba95f
Cars Report
This example demonstrates how JavaScript modules and asynchronous data fetching can generate a text-based report of cars under a given price threshold. It loads car data from a hardcoded JSON array via the `getCars()` promise, filters and formats entries using `generateReport()` and `formatCar()`, then displays the result in an HTML `<pre>` element. The code uses native ES6 features like object destructuring, `Array.filter`, `Array.map`, and template literals, with `setTimeout` simulating a delayed API response.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.