Skip to main content
100%

Fork of Cars Report

✓ Published0🌍 Public
BBeihaiTianming
Last edited Feb 18, 2021
Created on Feb 18, 2021
Forked from Cars Report

This example demonstrates a simple async data-fetching and filtering workflow for a car inventory. It shows a list of car descriptions, formatted as “year make model: $price,” displayed in a large `<pre>` element after a simulated two-second delay. The code uses JavaScript modules to separate concerns: `getCars.js` parses a hardcoded JSON array and returns a Promise, `formatCar.js` formats each car object, and `generateReport.js` filters cars under a price threshold and joins the results. The main script updates the DOM via `getElementById` and handles the Promise resolution.

AI-generated description

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

MIT Licensed

Similar vizzes