Should I use console.error() or throw new Error()

Milena Komnenic - Aug 20 - - Dev Community

Both error handling ways seem reliable and used. But my question is:

Is there a difference between them? And if there is, when should I use which?
The key difference is: throwing halts the execution, while console.error does not.

Most of the time, it's better to throw an error.
The problem with console.error is that it does not really throw an error that stops the execution of the program , something that throw Error does .

. .
Terabox Video Player