throw Error vs throw new Error code example
Example 1: throw new error(
throw new Error("Your error message");
Example 2: javascript throw new error
throw new Error("Error message here"); // Uncaught Error: Error message here
Example 3: throw new error(
throw new Error('Whoops!')