Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Cars Report

Public visualization

Viewing a saved revision (read-only)

ba912061ed8f493386996fad81dbff06

Cars Report

0 stars0🌍 Public
Sssd4
Last edited Feb 3, 2020
Created on Feb 1, 2020
Forked from Cars Report

This example demonstrates a text-based report of used cars, filtered by price and formatted into a readable list. It shows how asynchronous data retrieval works with a Promise-based `getCars` function that simulates a two-second delay before returning a JSON array of car objects. The `generateReport` module filters cars under a specified maximum price and maps each entry to a string using `formatCar`, which combines year, make, model, and price. The final output is displayed in a `<pre>` element on the page, updated via `document.getElementById` after the promise resolves.

AI-generated description

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