Cars Report
✓ Published0🌍 Public
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 descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed