Viewing a saved revision (read-only)
a3c4a442506046a680b2638cc7d389a1
Cars Report
This example demonstrates a JavaScript-based report generator that displays a filtered list of cars under a specified price threshold. The visualization initially shows a "loading..." message, then asynchronously fetches car data after a 2-second delay using a Promise. The report formats each car's year, make, model, and price using the `formatCar` function, and filters the dataset with `generateReport`. The code separates concerns across modules, with `getCars` providing mock JSON data and `index.js` coordinating the UI update through DOM manipulation. The final output appears as a plain text list in the browser.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.