how to throw an error exception in javascript code example
Example 1: js throw error
throw new Error('Whoops!')
Example 2: js throw new error
throw new Error("message");
throw new Error('Whoops!')
throw new Error("message");