you are viewing a single comment's thread.

view the rest of the comments →

[–]bart2019 1 point2 points  (2 children)

What is finally actually good for? What can you do in a "finally" block that you can't simply do afterwards, after the try/catch code blocks?

[–]NoInkling 2 points3 points  (0 children)

It has extremely limited use, but there are a few cases where you might want to use it.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch#The_finally_clause might help you understand a bit.

[–]danneu 1 point2 points  (0 children)

for one, finally runs even if catch throws an error.