Cars Report
✓ Published0🌍 Public
This example demonstrates how to generate a text-based report from a hardcoded array of car objects, listing vehicles priced under $2,000 in the format “year make model:$$price.” The interface initially displays “Loading…” while the `getCars` function simulates a two-second delay with a promise before data is processed. The `generateReport` module filters the array, maps each car through the `formatCar` utility, and joins results on newlines. The page updates via `document.getElementById` to replace the loading message with the final report.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed