Skip to content

Instantly share code, notes, and snippets.

@kepta

kepta/block16.js Secret

Last active February 21, 2018 15:03
Show Gist options
  • Save kepta/2da0041727213f9a6c827644fcc136e2 to your computer and use it in GitHub Desktop.
Save kepta/2da0041727213f9a6c827644fcc136e2 to your computer and use it in GitHub Desktop.
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