Let's say I have this code:
promise.done(function (x) {
// First done()
console.log(x);
return 123;
}).fail(function (x){
// First fail()
console.log(x);
}).then(function (x){
// First then()
console.log(x)
}).fail(function (x){
// Second fail()
console.log(x);
}).done(function (x){
// Second then()
console.log(x);
});
How will this execute? If nothing goes wrong, will the chain of execution be:
1. The first done()
2. The first then()
3. The second done()
If something goes wrong in the first done, will both the first and second fail()
be called?
Sorry for the new question, I'm trying to learn how chaining works with promises. Thanks!