Skip to main content
100%

Cars Report

✓ Published0🌍 Public
TTomoyukiEguchi
Last edited Jan 17, 2021
Created on Dec 25, 2020
Forked from D3 Starter

This example demonstrates a simple report generator that lists cars under a specified price after a brief loading delay. It shows how JavaScript modules and Promises work together to fetch and filter data, displaying formatted car details in a plain HTML `<pre>` element. The code uses a custom `getCars()` function that returns a Promise resolving to a JSON-parsed array of car objects, and a `generateReport()` function that filters by price and formats each entry using `formatCar`. The report is triggered asynchronously via `getCars().then()`, with the page initially showing “Loading...” before results appear.

AI-generated description

An example tutorial of how to use Javascript objects, array, and modules.

MIT Licensed

Similar vizzes