🌍 Public
Viewing a saved revision (read-only)
225dbb4c634346f996abd7d4269753ad
Cars Report
This example demonstrates how asynchronous data fetching and modular JavaScript can be used to generate a simple text-based report of used cars. After a two-second simulated delay, a list of cars priced under $2,000 is displayed on the page. The code relies on native ES modules for importing and exporting functions, the `Promise` API with `setTimeout` for the delayed data retrieval, and `JSON.parse` to convert an embedded JSON string into an array of car objects. The final output is rendered into a `<pre>` element using the DOM method `textContent`.
AI-generated descriptionAn example tutorial of how to use JavaScript objects, arrays, and modules.