js new exception code example
Example 1: js throw error
throw new Error('Whoops!')
Example 2: user defined exceptions in js
throw new Error('Exception message');
throw new Error('Whoops!')
throw new Error('Exception message');