If you've spent any amount of time developing in AngularJs, you've probably run into the "stack trace of doom" which looks something like this:
throw 'This is an error' to create an error state for their app. Throwing errors this way is a bad idea and a good way to end up with the "stack trace of doom" as AngularJs will catch the error on the next digest cycle and give you its internal stack trace.
throw new Error('This is an Error'). Using the Error object will not only give you the line number, it will give you a neat stack trace of the error and make your debugging easier.