Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Cars Report

Public visualization

Viewing a saved revision (read-only)

99f64067a9574694b7a3fc8cf547b73e

Cars Report

0 stars1🌍 Public
JJames
Last edited Aug 14, 2020
Created on Aug 14, 2020
Forked from Cars Report

This example demonstrates a simple report that lists cars priced under $2,500, using asynchronous data loading and string formatting. It shows how JavaScript modules, promises, and array methods like `filter`, `map`, and `join` work together. The code defines `getCars()` to return a promise that resolves after a 2-second delay, simulating a fetch of static JSON data, while `generateReport` filters and formats each car via the `formatCar` function. The final output replaces the loading text in the DOM with a multiline message, rendered inside a `<pre>` element.

AI-generated description

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