throwing error in catch code example
Example 1: js throw error
throw new Error('Whoops!')
Example 2: javascript how to raise the error
if (..condition..) {
throw 'Error message';
}
Example 3: try catch error
try {
console.log('hello');
}
catch (e){
}