# The Object hasOwnProperty() method

> Learn how the JavaScript hasOwnProperty() method checks if an object has a property of its own, returning true or false for the property name you pass in.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2019-04-17 | Topics: [JavaScript](https://flaviocopes.com/tags/js/) | Canonical: https://flaviocopes.com/javascript-object-prototype-hasownproperty/

Called on an object instance, accepts a string as argument. If the object has a property with the name contained in the string argument, it returns `true`. Otherwise it returns `false`.

Example:

```js
const person = { name: 'Fred', age: 87 }
person.hasOwnProperty('name') //true
person.hasOwnProperty('job') //false
```
