TypeError: "x" has no properties

訊息

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

錯誤類型

哪裡錯了?

nullundefined 並沒有可訪問的屬性。

示例

null.foo;
// TypeError: null has no properties

undefined.bar;
// TypeError: undefined has no properties

參見