Cars Report
✓ Published0🌍 Public
This example demonstrates how to generate a plain-text car report by filtering a hardcoded JSON array of five vehicles and formatting each result. The page initially shows “Loading…” and then displays a list of cars priced under $2,000 after a simulated two-second delay. The code uses JavaScript modules with `export`/`import` to separate data retrieval (`getCars` returning a Promise), formatting via `formatCar`, and filtering/joining logic in `generateReport`. The final output is rendered into a `<pre>` element using `textContent`.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed