TypeError: "x" has no properties

错误信息

TypeError: null has no properties
TypeError: undefined has no properties

错误类型

哪里出错了?

nullundefined中,没有你需要的属性。

示例

js

null.foo;
// 错误类型:null 没有这个属性

undefined.bar;
// 错误类型:undefined 没有这个属性

参考