Created
June 4, 2019 12:42
-
-
Save alnorris/9f4c2689be44e158c862b2ed31107616 to your computer and use it in GitHub Desktop.
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
function promiseAll(arr) { | |
// fill this in | |
} | |
promiseAll([Promise.resolve(1), Promise.resolve(4)]).then(resp => { | |
console.log(resp) | |
}) | |
.catch(e => console.log(e)) | |
promiseAll([Promise.resolve('success'), Promise.reject('Error!')]).then(resp => { | |
console.log(resp) | |
}) | |
.catch(e => console.log(e)) | |
// Print below: | |
// [ 1, 4 ] | |
// Error! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment