A Pen by Sindre Svendby on CodePen.
Created
August 8, 2016 13:23
-
-
Save SindreSvendby/7f099b6b7f2280e6ca92ceb20f9b3eec to your computer and use it in GitHub Desktop.
promise example return Reject.
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
var b = Promise.reject() | |
.then(response => Promise.resolve('ok')) | |
.catch((error) => { | |
return Promise.reject('error'); | |
}); | |
b.then(value => console.log(value)) | |
.catch(value => console.log(value)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment