Cars Report
✓ Published1🌍 Public
This example displays a simple text report of cars whose price falls below a user-defined maximum, formatted as a list of year, make, model, and price lines. It demonstrates asynchronous data retrieval with a Promise-based `getCars` function (using `setTimeout` to simulate a delay), and modular JavaScript with ES6 imports and exports. The report is generated by filtering an in-memory JSON array, mapping each car through the exported `formatCar` function, and joining the results with line breaks before updating the DOM’s `textContent`. The initial “Loading...” message is replaced once the promise resolves.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed