Skip to main content
100%

Cars Report

✓ Published0🌍 Public
Yyuanjunandrew
Last edited Jan 14, 2020
Created on Jan 14, 2020
Forked from Cars Report

This example demonstrates asynchronous data loading and report generation from a static JSON dataset. It defines a `getCars` function that returns a Promise, simulating a two-second network delay, while the page displays “Loading...” during that wait. Once resolved, the `generateReport` function filters cars priced under $2,000, formats each entry using a template literal that concatenates year, make, model, and price, then writes the multi-line list into the DOM as text. The code relies on ES modules, `Promise` resolution, and array methods like `filter` and `map`.

AI-generated description

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

MIT Licensed

Similar vizzes