TypeError: "x" has no properties

Message

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

Error type

TypeError.

What went wrong?

Both, null and undefined, have no properties you could access.

Examples

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

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

See also

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/javascript/reference/errors/no_properties

Errors JavaScript TypeError