js catch errors code example
Example 1: javascript try
var someNumber = 1;
try {
someNumber.replace("-",""); //You can't replace a int
} catch(err) {
console.log(err);
}
Example 2: try catch error
try {
console.log('hello');
}
catch (e){
}
var someNumber = 1;
try {
someNumber.replace("-",""); //You can't replace a int
} catch(err) {
console.log(err);
}
try {
console.log('hello');
}
catch (e){
}