3 ms·
> `catch` automatically unsets the function's result. Do you mean finally? Even so, it doesn't automatically unset the result, it's just able to overwrite it.
by jonny_eh 5y ago
> `catch` automatically unsets the function's result.
Do you mean finally? Even so, it doesn't automatically unset the result, it's just able to overwrite it. If a finally doesn't execute a return or throw, the previous one is used.
- jaffathecake 5y agoI don't mean finally, because it'd be wrong for the reasons you list. catch however always unsets the result. If you don't manually throw or return from a catch, then the result is an empty result (which is JavaScript is a return of undefined) finally doesn't do anything automatically, but a throw or a return changes the result.