Skip to main content
100%

Cars Report

✓ Published0🌍 Public
AAhmed Negm
Last edited Aug 10, 2020
Created on Aug 10, 2020
Forked from HTML Starter

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 description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes