How Errors are inferior and superior to bare strings
What is Error?
It is an ordinary class. The modern constructor of
Error has two parameters, both are optional:
new Error(message, options)
Just creating a new
Error object has no special effect. To interrupt code execution and see an error message in the console, the
Error has be thrown with a