Cars Report
✓ Published0🌍 Public
This example demonstrates an asynchronous text report generator. It shows how a React-based web application loads mock data and filters it to display a formatted list of cars under a price threshold. The code uses static JSON parsed with `JSON.parse` and a delayed Promise via `setTimeout` to simulate fetching data. The `getCars` function returns a Promise, and `generateReport` filters and maps car objects using `Array.filter` and `Array.map`, while `formatCar` constructs descriptive strings. The report appears in an HTML `<pre>` element after a "Loading..." state.
AI-generated descriptionA bare minimum HTML page.
See also React Starter.
MIT Licensed