Created
October 3, 2017 15:33
-
-
Save ofirdagan/9ad5de348a0c18e8ab9002d264febdf5 to your computer and use it in GitHub Desktop.
What will that print? - async
This file contains 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 wrapper() { | |
const foo = async () => { | |
return true; | |
}; | |
const goo = async () => { | |
return Promise.resolve(true); | |
}; | |
const x = foo(); | |
console.log(`x: ${x}`); | |
const y = await foo(); | |
console.log(`y: ${y}`); | |
const x2 = goo(); | |
console.log(`x2: ${x2}`); | |
const y2 = await goo(); | |
console.log(`y2: ${y2}`); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment