Last active
April 19, 2017 09:59
-
-
Save gskachkov/2e8aae349326cac93070b26ed0e09412 to your computer and use it in GitHub Desktop.
Example of the declaration async function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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