1.SyntaxError (Syntax error)
Syntax error occurred while parsing the code
Eg:var 1a;
uncaught syntaxerror:unexpected Number
2.ReferenceError (reference error)
A. Referencing a non-existent variable
Eg:console.log (a);
Uncaught referenceerror:a is not defined
B. Assigning a variable to an object that cannot be assigned a value
Eg:console.log () = 1;
Uncaught referenceerror:invalid left-hand side in assignment
3.RangeError (range error)
Out of valid range
Eg:var a= New Array (-1);
Uncaught rangeerror:invalid Array length
4.TypeError (type error)
A. The variable or parameter is not the expected type, such as the use of the new command for values of primitive types such as strings, booleans, numeric values, and so on, because the parameters of the new command should be a constructor.
Eg:var a= New 123;
Uncaught typeerror:123 is not a function
B. Methods for calling objects that do not exist
Eg:var A;a.aa ();
Uncaught typeerror:cannot Read property ' AA ' of undefined
5.URLError (URL error)
The URL-related function parameters are incorrect, mainly the six functions of encodeURI (), decodeURI (), encodeURIComponent (), decodeURIComponent (), Escape (), and unescape ().
Eg:decodeuri ('%2 ')
Uncaught Urierror:uri Malformed
6.EvalError (eval error)
The eval function was not executed correctly
Original link: https://www.cnblogs.com/yanze/p/5997489.html
JavaScript error type ———— Quack No. second