-
-
Save kepta/201f68a2dc2eb7c498096eca1cd66689 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.resolve(5); | |
var prom2 = fetchServerStatus(); // returns a promise of {statusCode: 200} | |
Proimise.all([prom1, prom2]) | |
.then([val1, val2] => { // notice that it resolves into an Array | |
console.log(val1); // 5 | |
console.log(val2.statusCode); // 200 | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment