Cars Report
✓ Published0🌍 Public
This example demonstrates how JavaScript modules, arrays, and asynchronous functions generate a text-based car report. It loads a hardcoded JSON array of five cars, filters for models under $2,000, and formats each result into a line. The code uses `getCars()` with a `Promise` and `setTimeout` to simulate a delay, `generateReport()` with `.filter()` and `.map()`, and `formatCar()` for string interpolation. The final report is displayed in an HTML `<pre>` element using `document.getElementById()` and `.textContent`.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed