Skip to main content
100%

Cars Report

✓ Published0🌍 Public
PPaulCaballero
Last edited Aug 22, 2019
Created on Aug 22, 2019
Forked from Cars Report

This example demonstrates a simple text-based report of car listings, showing each car’s year, make, model, and price when priced under a given threshold. The page initially displays “Loading…” while a promise-based `getCars()` function simulates a two-second delay before resolving a hardcoded JSON array of five cars. The `generateReport()` function filters the array, maps each car through `formatCar()` to format the string, and joins them with newlines into a single report. No external libraries are used; the code relies on native JavaScript promises, array methods, and ES modules.

AI-generated description

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

MIT Licensed

Similar vizzes