async, await and use of "producing code and consuming code"
This page shows an example of how the Fetch() method csn be used to read text from a file on
the webserver. The file in this case is called fetch_info.txt
The file can contain anything you like, in my case you will see the contents when you click the button (or here).
The syntax of async (the asynchronous function) is:
The keyword async before a function makes the function return a promise:
async function myFunction() {
return "Hello";
}
Is the same as:
async function myFunction() {
return Promise.resolve("Hello");
}