Skip to main content
100%

Cars Report

✓ Published0🌍 Public
Kkalokli8
Last edited Mar 31, 2020
Created on Mar 31, 2020
Forked from Cars Report

This example demonstrates a simple text-based report of used cars, displaying a filtered list of vehicles priced under $2,000 in a large HTML `<pre>` element. It shows how JavaScript modules and Promises structure asynchronous data loading and formatting. The code defines `getCars()` to return a Promise that resolves a hardcoded JSON array after a two-second delay, while `generateReport()` filters and maps the data using the `formatCar` helper. The main script updates the page’s `textContent` from “Loading...” to the final report, using ES6 module imports and exports.

AI-generated description

An example tutorial of how to use JavaScript objects, arrays, and modules.

MIT Licensed

Similar vizzes