What is the difference between `throw 'foo'`, `throw Error('foo')`, `throw new Error('foo')`?

Viewed 1542

I've seen 3 different ways of throwing an error in JavaScript:

throw 'message';
throw Error('message');
throw new Error('message');

What is the difference between them?

Note: I am aware of similar questions (1,2,3, etc). None of them cover all three cases.

1 Answers
Related