Created
February 4, 2022 14:07
-
-
Save DaveBitter/6519e645c19e8f099d0a7284fd22a9ca to your computer and use it in GitHub Desktop.
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 () => { | |
const promiseA = new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve({data: 'dataA', error: 'errorA'}); | |
}, 2000); | |
}) | |
const promiseB = new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve({data: 'dataB', error: 'errorB'}); | |
}, 2000); | |
}); | |
const result = await Promise.all([promiseA, promiseB]); | |
console.log(result); | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment