The try statement allows us to define a block of code that performs error testing at execution time.
The catch statement allows us to define a block of code that executes when a try block of code has an error.
The JavaScript statement try and catch are paired occurrences.
Syntax:try { // Run code here } catch(err (where err is the front error, if throw is used in try) There is an error result thrown for the front throw. ) { // handle error here }
The throw statement allows us to create custom errors.
The correct technical term is: Create or throw an exception (exception).
If you use throw with try and catch, you can control the flow and generate custom error messages.
Syntax:Throw
exception (Exception)
An exception can be a JavaScript string, a number, a logical value, or an object.
Debugging:
The debugger keyword is used to stop executing JavaScript and invoke the Debug function.
This keyword has the same effect as setting breakpoints in the Debug tool.
If no debugging is available, the debugger statement will not work.
About debugging specific steps to achieve supplement (follow-up write)
JS preparation for Spring recruit four のdevtool of various errors, debugging the use of skills