Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Cars Report

Public visualization

Cars Report

0 stars0🌍 Public
GGaurav Prachchhak
Last edited Jan 22, 2020
Created on Jan 22, 2020
Forked from Cars Report

This example demonstrates how JavaScript modules, arrays, and asynchronous functions generate a text-based car report. It loads a hardcoded JSON array of five cars, filters for models under $2,000, and formats each result into a line. The code uses `getCars()` with a `Promise` and `setTimeout` to simulate a delay, `generateReport()` with `.filter()` and `.map()`, and `formatCar()` for string interpolation. The final report is displayed in an HTML `<pre>` element using `document.getElementById()` and `.textContent`.

AI-generated description

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

Comments

Sign in to join the discussion.

MIT Licensed