このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docsコミュニティーについてもっと知り、仲間になるにはこちらから。
TypeError: "x" has no properties
JavaScript の例外 "null (or undefined) has no properties" は、null およびundefined のプロパティにアクセスしようとしたときに発生します。これらはプロパティを何も持ちません。
In this article
エラーメッセージ
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)エラータイプ
TypeError何がうまくいかなかったのか?
例
>null と undefined にはプロパティがない
js
null.foo;// TypeError: null has no propertiesundefined.bar;// TypeError: undefined has no properties