Cars Report
✓ Published1🌍 Public
This example demonstrates a loading state and a text report of cars under a price threshold, using JavaScript promises and array methods. It fetches car data from a hardcoded JSON string via the `getCars` function, which resolves after a 2-second delay. The `generateReport` function filters cars by price and formats each entry using the `formatCar` utility, displaying results in a `<pre>` element. The page initially shows "Loading..." then updates with the report, relying on native `Promise`, `setTimeout`, and DOM manipulation through `getElementById`.
AI-generated descriptionAn example tutorial
MIT Licensed