Answers for "new exception javascript"

39

js throw error

throw new Error('Whoops!')
Posted by: Guest on March-17-2020
5

javascript how to raise the error

if (..condition..) {
    throw 'Error message';
  }
Posted by: Guest on May-14-2020
3

js errors

JS Error Name Values:
name
Sets or returns the error name
message
Sets or returns an error message in string from
EvalError
An error has occurred in the eval() function
RangeError
A number is “out of range”
ReferenceError
An illegal reference has occurred
SyntaxError
A syntax error has occurred
TypeError
A type error has occurred
URIError
An encodeURI() error has occurred
Posted by: Guest on January-04-2021

Browse Popular Code Answers by Language