Created
January 9, 2018 18:46
-
-
Save omartrigui/68476941e04ff4c8b7d4eb7a07742500 to your computer and use it in GitHub Desktop.
Async/Await
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
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('xDD'), 2000); | |
}); | |
} | |
async function go() { | |
const coffee = await getCoffee(); | |
console.log(coffee); | |
} | |
go(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment