Cars Report
✓ Published1🌍 Public
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 descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed