Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1065412 of TypeError: "x" has no properties

  • Revision slug: Web/JavaScript/Reference/Errors/No_properties
  • Revision title: TypeError: "x" has no properties
  • Revision id: 1065412
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment new page

Revision Content

{{jsSidebar("Errors")}}

Message

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

Error type

{{jsxref("TypeError")}}.

What went wrong?

Both, {{jsxref("null")}} and {{jsxref("undefined")}}, have no properties you could access.

Examples

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

undefined.bar;
TypeError: undefined has no properties

See also

  • {{jsxref("null")}}
  • {{jsxref("undefined")}}

Revision Source

<div>{{jsSidebar("Errors")}}</div>

<h2 id="Message">Message</h2>

<pre class="syntaxbox">
TypeError: null has no properties
TypeError: undefined has no properties
</pre>

<h2 id="Error_type">Error type</h2>

<p>{{jsxref("TypeError")}}.</p>

<h2 id="What_went_wrong">What went wrong?</h2>

<p>Both, {{jsxref("null")}} and {{jsxref("undefined")}}, have no properties you could access.</p>

<h2 id="Examples">Examples</h2>

<pre class="brush: js example-bad">
null.foo;
// TypeError: null has no properties

undefined.bar;
TypeError: undefined has no properties
</pre>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{jsxref("null")}}</li>
 <li>{{jsxref("undefined")}}</li>
</ul>
Revert to this revision