try catch breaks if else javascript code example
Example: try catch javascript
try {
// code may cause error
} catch(error){
// code to handle error
}
try {
// code may cause error
} catch(error){
// code to handle error
}