Skip to main content
100%

Fork of purge tool

✓ Published0🌍 Public
Aakshayms0
Last edited Dec 26, 2022
Created on Dec 26, 2022

This example demonstrates a JavaScript data-processing pipeline that filters a car inventory and formats the results into a text report. The code uses a hardcoded JSON array of car objects (year, make, model, price) as its data source, loaded asynchronously via a Promise with a 2-second delay. The `getCars` module parses the JSON, while `generateReport` filters cars under a $2000 price threshold and maps each to a formatted string using the `formatCar` function. The final output, a list of qualifying cars, is displayed in an HTML `<pre>` element with a "Loading..." placeholder shown before the Promise resolves.

AI-generated description

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

MIT Licensed

Similar vizzes