new error() javascript code example
Example 1: javascript throw new error
throw new Error("Error message here"); // Uncaught Error: Error message here
Example 2: user defined exceptions in js
throw new Error('Exception message');
throw new Error("Error message here"); // Uncaught Error: Error message here
throw new Error('Exception message');