Put in order · JavaScript and TypeScript course · Module 2: Functions, Arrays and Objects
Error Basics - Handling Order
Arrange the stages of error handling in JavaScript from the moment the problem occurs:
Items to put in order
- The program continues execution after the try/catch/finally block
- Code in the try block encounters an error
- The catch block handles the error (logging, recovery)
- The finally block performs cleanup operations (resource cleanup)
- Execution passes to the catch block with the error object
Show the answer
Correct order:
- Code in the try block encounters an error
- Execution passes to the catch block with the error object
- The catch block handles the error (logging, recovery)
- The finally block performs cleanup operations (resource cleanup)
- The program continues execution after the try/catch/finally block