What is the difference between these two statements, and is there a good reason to use one over the other?
throw Error("msg");
console.error("msg");
In my limited experience, I've only really seen throw Error()
used. Is there any particular reason why?
Also, is there an equivalent to console.warn()
in the same fashion?
console.error
is just used for print theerror
& go on, butthrow
will won't go further .