🌍 Public
Viewing a saved revision (read-only)
aa9a7f844bd443e48290d3d0908c92a5
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.