Skip to main content
100%

Cars Report

✓ Published0🌍 Public
Bbasghetti
Last edited Dec 3, 2019
Created on Dec 3, 2019
Forked from Cars Report

This example demonstrates a data-report generator that filters a list of used cars by price and displays the results as formatted text. The page initially shows “Loading…”, then, after a two-second delay, it renders a report of cars under a $2000 threshold, listing each vehicle’s year, make, model, and price. It uses JavaScript objects and arrays with asynchronous logic via a Promise in `getCars` to simulate a data fetch, while `generateReport` and `formatCar` handle filtering and string formatting. The output appears in a `<pre>` element and updates through standard DOM manipulation with `document.getElementById`.

AI-generated description

An example tutorial of how to use JavaScript objects, arrays, and modules.

MIT Licensed

Similar vizzes