Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Cars Report

Public visualization

Viewing a saved revision (read-only)

209f291d6f5e42a5bfc43e50cb6fcc10

Cars Report

0 stars0🌍 Public
DDuyun Tan
Last edited Feb 24, 2020
Created on Feb 24, 2020
Forked from Cars Report

This example demonstrates a text-based report of used cars, filtering and formatting a small dataset into readable lines. It shows how JavaScript modules handle asynchronous data and string generation. The code uses `getCars()` with a `Promise` and `setTimeout` to simulate a two-second loading delay, while `generateReport` chains `filter`, `map`, and `join` to prepare the output. The report renders in a `<pre>` element, initially showing "Loading..." and later the formatted list of cars under a price threshold. The example highlights ES module exports, template literals, and array methods like `filter` and `map`.

AI-generated description

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