Data Fetcher (Asnyc/Await Promise.Then)
✓ Published1🌍 Public
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.
MIT Licensed