Cars Report
✓ Published0🌍 Public
This example shows a JavaScript tutorial that filters a list of cars and formats them into a text report. The code parses a hardcoded JSON array using `JSON.parse`, applies `.filter()` to select cars priced under $2000, and uses `.map()` with a `formatCar` function to format each car’s year, make, model, and price. The resulting report is rendered as plain text into an HTML `<pre>` element via `document.getElementById('msg').textContent`. It demonstrates basic array methods, object destructuring, and template literals without external libraries.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.
MIT Licensed