Created
May 9, 2017 14:06
-
-
Save gskachkov/b0c61c98a70f17bc7c7b3dc0d9e9a563 to your computer and use it in GitHub Desktop.
Async function declaration
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; | |
} | |
const boo = async function () { | |
return await fetch("https://randomuser.me/api/?results=10", { method: "GET" }); | |
}; | |
foo(); | |
boo(); | |
function foobar() { | |
const result = await fetch("https://randomuser.me/api/?results=10", { method: "GET" }); | |
return result; | |
} | |
// SyntaxError |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment