HTML Cars Report
✓ Published1🌍 Public
This example demonstrates a simple asynchronous report that filters a hardcoded JSON array of used cars by price and displays the results as text on a webpage. It shows a loading message initially, then after a simulated two-second delay, the filtered list of cars under $2000 appears. The code uses JavaScript modules with `export` and `import` statements, including `getCars()` which returns a Promise via `setTimeout`, `generateReport()` which chains `filter()` and `map()`, and `formatCar()` for string formatting. The DOM is updated using `document.getElementById` to change the text content of a message element.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed