🌍 Public
Viewing a saved revision (read-only)
a3a07d4b956e43b2b87dcf56d76c2194
Data Fetcher (Asnyc/Await Promise.Then)
This example demonstrates two techniques for fetching remote data in JavaScript and logging the results to the console. The page uses the Fetch API to retrieve a CSV file of CSS named colors from a GitHub gist, with the data returned as raw text. The code contrasts the use of `async`/`await` syntax within an `async function` against the older `Promise` chaining approach via `.then()` methods. Both methods successfully retrieve the same resource, while a plain `console.log` statement prints a separate message to show the order of execution. The example is implemented as a minimal HTML page inside a React project scaffold.
AI-generated descriptionA bare minimum HTML page.
See also React Starter.