🌍 Public
Viewing a saved revision (read-only)
0abbf72559674be7b1f35dd276fcd41e
Cars Report
This example displays a text-based report of cars filtered by price, showing formatted entries such as "2000 Honda accord: $2600" in a large <pre> element. The page initially shows a "Loading..." message while a Promise from `getCars()` waits two seconds before resolving with a hardcoded JSON array of car objects. After resolution, the `report` function filters cars using `Array.filter`, formats each with a template literal, and joins them with newlines. The React framework is present in the starter code, though the core logic uses plain JavaScript Promises and DOM manipulation via `document.getElementById`.
AI-generated descriptionReact Starter code.