Last active
August 29, 2018 03:17
-
-
Save amakhrov/8d9578c5e228c16f2e85ef73347fca75 to your computer and use it in GitHub Desktop.
Promises - parallel
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
const asyncA = () => Promise.resolve('A'); | |
const asyncB = () => Promise.resolve('B'); | |
// Please write a function that calls these 2 async functions in parallel and combines the results into a single object. | |
// asyncA and asyncB are independent, should be called in parallel. | |
const callAsync = () => { | |
// your code should be here | |
// ... | |
} | |
callAsync().then(result => console.log(result)); // should print: {a: 'A', b: 'B'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment