Cars Report
✓ Published0🌍 Public
This example demonstrates asynchronous data loading and report generation from a static JSON dataset. It defines a `getCars` function that returns a Promise, simulating a two-second network delay, while the page displays “Loading...” during that wait. Once resolved, the `generateReport` function filters cars priced under $2,000, formats each entry using a template literal that concatenates year, make, model, and price, then writes the multi-line list into the DOM as text. The code relies on ES modules, `Promise` resolution, and array methods like `filter` and `map`.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed