SyntaxError 语法错误

var 1 = 1;
var 1ab = 1;
var a = 1 = 2;

Untitled

Untitled

Untitled

ReferenceError 引用错误

变量 or 函数未被声明

test();
console.log(a);

Untitled

Untitled

var a = 1;
console.log(a) = 1;

Untitled

RangeError 范围错误

数组长度设置负值

var arr = [1, 2, 3];
arr.length = -1;

Untitled

对象方法参数,超出可行范围

var num = new Number(66.66);
console.log(num.toFixed(-1));

Untitled

TypeError 类型错误