🌍 Public
Viewing a saved revision (read-only)
5f68a9deceab4f44a572530bc08573fa
Cars
This example shows a text-based report of used cars filtered by price. It loads a hardcoded JSON array of five car objects via `getCars()`, which returns a Promise that resolves after a simulated two-second delay. The `generateReport` function uses array `filter` and `map` methods, along with the `formatCar` utility, to produce a formatted list of cars under $2000, displayed in a `<pre>` element with a “Loading...” placeholder initially. The code demonstrates modular JavaScript with ES6 import/export syntax and asynchronous data handling.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.