Skip to main content
100%

Cars Report

✓ Published0🌍 Public
CChristina
Last edited Jun 16, 2020
Created on Jun 16, 2020
Forked from Cars Report

This example demonstrates a text-based data report for car listings, filtering and sorting cars by price before formatting each entry into a readable string. The page initially displays “Loading…” and then updates with the final report after a simulated two-second delay. The code uses JavaScript modules with `import`/`export` syntax, including `formatCar` for string templating, `generateReport` with a custom `compare` function for sorting, and `getCars` which returns a `Promise` resolved via `setTimeout`. The report is rendered into an HTML `<pre>` element using the DOM API `document.getElementById`.

AI-generated description

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

MIT Licensed

Similar vizzes