Skip to main content
100%

Cars Report

✓ Published0🌍 Public
Ppradeep90605
Last edited Jun 18, 2020
Created on Jun 18, 2020
Forked from Cars Report

This example demonstrates a JavaScript module workflow for generating a text-based car report. It defines a data array of five car objects embedded in `getCars.js`, then uses `Array.filter` and `Array.map` in `generateReport` to select vehicles priced below 2000, formatting each result with `formatCar`. The asynchronous `getCars` function returns a Promise that resolves after a two-second delay, mimicking an API call. The final report is displayed inside an HTML `<pre>` element using the browser’s `document.getElementById` API.

AI-generated description

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

MIT Licensed

Similar vizzes