Skip to content

Instantly share code, notes, and snippets.

@gskachkov
Last active April 19, 2017 09:59
Show Gist options
  • Save gskachkov/2e8aae349326cac93070b26ed0e09412 to your computer and use it in GitHub Desktop.
Save gskachkov/2e8aae349326cac93070b26ed0e09412 to your computer and use it in GitHub Desktop.
Example of the declaration async function
async function foo () {
const result = await fetch("https://randomuser.me/api/?results=10", { method: "GET" });
return result;
}
async function bar() {
console.log(await foo());
};
bar();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment