TypeError: "x" has no properties

We’d love to hear your thoughts on the next set of proposals for the JavaScript language. You can find a description of the proposals here.
Please take two minutes to fill out our short survey.

JavaScript の例外 "null (or undefined) has no properties" は、 null および undefined のプロパティにアクセスしようとしたときに発生します。これらはプロパティを何も持ちません。

エラーメッセージ

js
TypeError: Unable to get property {x} of undefined or null reference (Edge)
TypeError: null has no properties (Firefox)
TypeError: undefined has no properties (Firefox)

エラータイプ

何がうまくいかなかったのか?

nullundefined に、アクセス可能なプロパティはありません。

null と undefined にはプロパティがない

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

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

関連項目