错误类型

TypeError:类型错误
ReferenceError:引用错误(a is not defined)(尚未声明)
SyntaxError: 语法错误( Unexpected token ( );例如//let不允许在相同作用域内,重复声明同一个变量。

a is not defined与undefined区别:
a is not defined:

  1. 会报错
  2. 尚未声明
    undefined:
  3. 不会报错
  4. 声明了,但是没有赋值
原文地址:https://www.cnblogs.com/sakura-sakura/p/6678393.html