-
-
Save kepta/2da0041727213f9a6c827644fcc136e2 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
var prom1 = Promise.reject(5); | |
var prom2 = fetchServerStatus(); // returns a promise of {statusCode: 200} | |
Proimise.all([prom1, prom2]) | |
.then([val1, val2] => { | |
console.log(val1); | |
console.log(val2.statusCode); | |
}) | |
.catch(e => console.log(e)) // 5, jumps directly to .catch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment