how to throw error in catch block javascript code example
Example 1: javascript how to raise the error
if (..condition..) {
throw 'Error message';
}
Example 2: javascript try
var someNumber = 1;
try {
someNumber.replace("-",""); //You can't replace a int
} catch(err) {
console.log(err);
}