Cars Report
✓ Published0🌍 Public
This example demonstrates a text-based report of cars filtered by price, displaying each vehicle's year, make, model, and cost as a formatted string list. It uses asynchronous JavaScript with a Promise-based `getCars` function that simulates a two-second network delay before returning a hardcoded JSON array. The `generateReport` module filters cars below a maximum price and applies the `formatCar` template literal for output. The page’s `<pre>` element initially shows "Loading..." and updates when the promise resolves. The code relies on ES modules, `JSON.parse`, and standard DOM methods like `textContent`.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed