Skip to main content
100%

Cars Report

✓ Published1🌍 Public
Aargonaeut
Last edited Nov 24, 2020
Created on Nov 24, 2020
Forked from React Starter

This example shows a text-based car report generated from a static JSON dataset, displaying vehicles with prices under $2,000. The page initially shows “Loading…” while `getCars()` simulates a two-second async fetch using a `Promise` and `setTimeout`. After the data loads, `generateReport` filters the parsed JSON array and maps each car through `formatCar`, which uses template literals to produce formatted strings. The final report is inserted into a `<pre>` element via `document.getElementById().textContent`, demonstrating array methods (`filter`, `map`, `join`) with ES6 modules.

AI-generated description

An example tutorial of how to use Javascript arrays and modules.

MIT Licensed

Similar vizzes