1 类型错误
Uncaught TypeError: undefined is not a function
eg:
var foo = undefined;
foo();
2 引用错误
Uncaught ReferenceError: Invalid left-hand side in assignment
eg:
if(doSomething() = 'somevalue')
3 循环引用的对象 传递给 JSON.stringfy 会引起错误
Uncaught TypeError: Converting circular structure to JSON
eg:
4 Unexpected token ;
eg :
5 语法错误
Uncaught SyntaxError: Unexpected token ILLEGAL
Unterminated String Literal, Invalid Line Terminator
字符串文本未终止,
6 类型错误
Uncaught TypeError: Cannot read property ‘foo’ of null, Uncaught TypeError: Cannot read property ‘foo’ of undefined
eg:
7 类型错误
Uncaught TypeError: Cannot set property ‘foo’ of null, Uncaught TypeError: Cannot set property ‘foo’ of undefined
eg:
8 范围错误
Uncaught RangeError: Maximum call stack size exceeded
eg: 函数无限递归调用
9 URI 错误
无效的 decodeURIComponent 调用所致
10 xmlHttpRequest引起的
XMLHttpRequest cannot load [http://some/url/](http://some/url/). No ‘Access-Control-Allow-Origin’ header is present on the requested resource
确保url是正确,保证同源策略
11 InvalidStateError 无效状态错误
InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable
引用一个无效的对象, 确保代码运行的时机正确