1EvalError:
2 Creates an instance representing an error that occurs regarding the global function eval().
3RangeError:
4 Creates an instance representing an error that occurs when a numeric variable or parameter is outside of its valid range.
5ReferenceError:
6 Creates an instance representing an error that occurs when de-referencing an invalid reference.
7SyntaxError:
8 Creates an instance representing a syntax error.
9TypeError:
10 Creates an instance representing an error that occurs when a variable or parameter is not of a valid type.
11URIError:
12 Creates an instance representing an error that occurs when encodeURI() or decodeURI() are passed invalid parameters.
13AggregateError:
14 Creates an instance representing several errors wrapped in a single error when multiple errors need to be reported by an operation, for example by Promise.any().
15InternalError:
16 Creates an instance representing an error that occurs when an internal error in the JavaScript engine is thrown. E.g. "too much recursion".
1JS Error Name Values:
2name
3Sets or returns the error name
4message
5Sets or returns an error message in string from
6EvalError
7An error has occurred in the eval() function
8RangeError
9A number is “out of range”
10ReferenceError
11An illegal reference has occurred
12SyntaxError
13A syntax error has occurred
14TypeError
15A type error has occurred
16URIError
17An encodeURI() error has occurred
1JS Errors
2try
3Lets you define a block of code to test for errors
4catch
5Set up a block of code to execute in case of an error
6throw
7Create custom error messages instead of the standard JavaScript errors
8finally
9Lets you execute code, after try and catch, regardless of the result
10
1<p id="demo"></p>
2
3<script>
4try {
5 adddlert("Welcome guest!");
6}
7catch(err) {
8 document.getElementById("demo").innerHTML = err.message;
9}
10</script>