Language
Version: 1.8.5
Categories
-
User Program Communication
-
Variables
-
Control Flow
-
Functions
-
Objects
Search Results
Searching for: Throw and Catch in JavaScript
Try Catch Block
Language: JavaScript
A try-catch block is used to mitigate errors in code and prevent program crashing during runtime. It 'tries' a block of code that could give an error. If the error is caught, it will execute a different block of code rather than crash the program (throw an error).