Skip to main content
100%

Cars Report

✓ Published1🌍 Public
JJames
Last edited Aug 14, 2020
Created on Aug 14, 2020
Forked from Cars Report

This example demonstrates a simple report that lists cars priced under $2,500, using asynchronous data loading and string formatting. It shows how JavaScript modules, promises, and array methods like `filter`, `map`, and `join` work together. The code defines `getCars()` to return a promise that resolves after a 2-second delay, simulating a fetch of static JSON data, while `generateReport` filters and formats each car via the `formatCar` function. The final output replaces the loading text in the DOM with a multiline message, rendered inside a `<pre>` element.

AI-generated description

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

MIT Licensed

Similar vizzes