throw catch in js code example
Example 1: js throw error
throw new Error('Whoops!')
Example 2: javascript try
var someNumber = 1;
try {
someNumber.replace("-",""); //You can't replace a int
} catch(err) {
console.log(err);
}
throw new Error('Whoops!')
var someNumber = 1;
try {
someNumber.replace("-",""); //You can't replace a int
} catch(err) {
console.log(err);
}