try catch break javascript code example
Example 1: catch error message js
try {
// test code
} catch (error) { // if error
console.error(error); // return error
}
Example 2: blank catch js
try {
try_statements
}
[catch [(exception_var)] {
catch_statements
}]
[finally {
finally_statements
}]