Skip to main content
100%

Cars Report

✓ Published1🌍 Public
Wwinniepooh520
Last edited Oct 1, 2020
Created on Sep 30, 2020
Forked from Cars Report

This example shows a plain-text report of five cars, filtering the dataset to display only models priced under $2,000 and formatting each as a single line with year, make, model, and price. The code imports car data from a JSON string in `cars.js` and uses the `formatCar` function to structure each entry, then joins the results with newlines for output. It relies on ES6 module imports and the native `JSON.parse` API, with the final message rendered into an HTML `<pre>` element via `document.getElementById`. The data source is a hardcoded JSON array of car objects.

AI-generated description

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

MIT Licensed

Similar vizzes