Skip to main content
100%

Cars Report

✓ Published0🌍 Public
YYineng Zhang
Last edited Oct 29, 2020
Created on Oct 29, 2020
Forked from Cars Report

This example builds a text-based report of cars under a $2,000 price limit, displaying each vehicle’s year, make, model, and price in a large HTML `<pre>` element. It demonstrates asynchronous data loading using a Promise with a simulated two-second delay via `setTimeout`, then filters and formats the car objects with JavaScript’s `filter`, `map`, and `join` methods. The code uses ES modules (`import`/`export`) to separate car retrieval, formatting, and report generation, and the final output is injected into the DOM through `textContent`.

AI-generated description

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

MIT Licensed

Similar vizzes