Question · JavaScript and TypeScript course · Module 2: Functions, Arrays and Objects
Error Basics - finally Block
When does the finally block execute in a try/catch/finally construct?
Answer options
- Only when an error occurs in the try block
- Always - regardless of whether an error occurred or not
- Only when no error occurs in the try block
- Only when the catch block successfully handles the error
Show the answer
Correct answer:
- Always - regardless of whether an error occurred or not