Fork of Cars Report
✓ Published0🌍 Public
This example demonstrates a simple async data-fetching and filtering workflow for a car inventory. It shows a list of car descriptions, formatted as “year make model: $price,” displayed in a large `<pre>` element after a simulated two-second delay. The code uses JavaScript modules to separate concerns: `getCars.js` parses a hardcoded JSON array and returns a Promise, `formatCar.js` formats each car object, and `generateReport.js` filters cars under a price threshold and joins the results. The main script updates the DOM via `getElementById` and handles the Promise resolution.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed