
Developer Defined Errors
We can also throw our own errors. This is done with the “throw” keyword using the “new” keyword and the Error method. Here is the syntax… Why would we do this? There might be times when your code logic won’t throw a JavaScript error, but something happens that you want