Created
September 23, 2016 18:16
-
-
Save juanpicado/88bf222a4286325f06e92887b406b090 to your computer and use it in GitHub Desktop.
async function example
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
const myPromise = (a) => { | |
return Promise.resolve(a); | |
} | |
async function foo() { | |
let d1 = await myPromise(1).then(console.log); | |
let d2 = await myPromise(2).then(console.log);; | |
} | |
foo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment