en.javascript.info/8-async/03-promise-chaining/01-then-vs-catch/solution.md
Ilya Kantor f57be1bbb3 work
2017-04-18 00:26:35 +02:00

342 B

The short answer is: no, they are not:

The difference is that if an error happens in f1, then it is handled by .catch here:

promise.then(f1).catch(f2);

...But not here:

promise.then(f1, f2);

That's because an error/result is passed down the chain, and in the second code piece there's no chain below.