JavaScript

Try/Catch

Definition

A statement for handling runtime errors gracefully. Code in the `try` block is executed, and if it throws an error, execution jumps to the `catch` block. The `finally` block runs regardless of success or failure.

Code Example

Javascript
Tip: Modify the code above and click “Run” to see the results

Learn More

Related Terms