Last active
August 29, 2015 14:16
-
-
Save towry/d01ad9572e1b26fc1821 to your computer and use it in GitHub Desktop.
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 = new Promise(function (resolve, reject) { | |
setTimeout(function(){ | |
reject(new Error("haha"));}) | |
}); | |
b.then(function(v){ | |
console.log(v); return 3; | |
}, function(e) { | |
console.log("error: " + e); | |
}).then(function(v){ | |
console.log("2: " + v); | |
}, function(e) { | |
console.log("error 2: " + e); | |
}); | |
// output | |
Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined} | |
VM565:2 error: Error: haha | |
VM565:2 2: undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment