I was digging through the proposal, the presentation, the spec draft, and the github issues, and I'm trying to get my head around the following:
As of now it seems that else/catch statements are mutually exclusive. I was wondering if the Promise implementation will somehow 'mirror' the 'behavior' of the statements (to my understanding that's not the case).
It seems that 'else' is the new 'catch', so that probably applies to Promises as well, meaning ideally only one should be used, not both? Nonetheless, if one ends up using both, is the following below correct?
I was digging through the proposal, the presentation, the spec draft, and the github issues, and I'm trying to get my head around the following:
As of now it seems that else/catch statements are mutually exclusive. I was wondering if the Promise implementation will somehow 'mirror' the 'behavior' of the statements (to my understanding that's not the case).
It seems that 'else' is the new 'catch', so that probably applies to Promises as well, meaning ideally only one should be used, not both? Nonetheless, if one ends up using both, is the following below correct?
try/catch/else/finally statements
Promise.prototype.then/else/catch/finally (assuming finally does make it into the spec https://github.com/tc39/proposal-promise-finally)
chaining:
branching: