throw exception in java script code example
Example 1: js throw error
throw new Error('Whoops!')
Example 2: throw new error(
throw new Error("Your error message");
throw new Error('Whoops!')
throw new Error("Your error message");