🌍 Public
Viewing a saved revision (read-only)
8a454dd1e32e4b7fa1bb5cffe86825e7
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.