JS: Check Property Existence

By Xah Lee. Date: . Last updated: .

Check If a Object Has Own Property

obj.hasOwnProperty(key)

[see JS: Object.prototype.hasOwnProperty]

Check If a Property is in Prototype Chain

To check if a property key is in a object obj's prototype chain (including if it's its own property), use one of:

JS Object Property

  1. Property Overview
  2. Property Key
  3. Dot vs Bracket Notation
  4. Create/Delete Property
  5. Get/Set Property
  6. Check Property Existence
  7. Access Property
  8. List Properties
  9. Property Attributes
  10. Getter/Setter
  11. Property Descriptor
  12. Symbol
Liket it? Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS in Depth
  4. JS Reference
  5. DOM
  6. SVG
  7. Web Dev Blog