Cars Report
✓ Published1🌍 Public
This example demonstrates a simple report that lists cars priced under $2,500, using asynchronous data loading and string formatting. It shows how JavaScript modules, promises, and array methods like `filter`, `map`, and `join` work together. The code defines `getCars()` to return a promise that resolves after a 2-second delay, simulating a fetch of static JSON data, while `generateReport` filters and formats each car via the `formatCar` function. The final output replaces the loading text in the DOM with a multiline message, rendered inside a `<pre>` element.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed