🌍 Public
Viewing a saved revision (read-only)
6c23b8caa96740e1957df111d8d901b1
Cars Report with Promises
This example demonstrates asynchronous data handling by displaying a filtered list of cars below a price threshold. A loading message appears first, then after a two-second delay, the report renders in large text. The code uses JavaScript Promises with `getCars` and `setTimeout` to simulate a delayed API response, while `generateReport` chains `filter`, `map`, and `join` operations to format car details from a hardcoded JSON array. The `formatCar` module constructs each line.
AI-generated descriptionAn example tutorial of how to use JavaScript arrays, objects, functions and modules.