> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itential.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server.

# objectHasOwnProperty

> Use the objectHasOwnProperty task to check whether an object has a specified property as its own property, returning a boolean result.

The `objectHasOwnProperty` task checks whether the object has a specified property as its own property. This is useful for checking if the object has inherited the property rather than being its own.

The result returns a boolean value (`true` or `false`) indicating whether the object has the given property as its own property. If the object has a property with the name contained in the string argument, it returns `true`. Otherwise it returns `false`.

## Potential use case

This task is a convenient method to check if a specific property exists in an object (or not) since it returns `true`/`false` accordingly. Using this task also allows you to test for properties you have manually created on your current object.

Another benefit of `objectHasOwnProperty` is that it can be initialized with any object by using the string as an argument. It returns `true` if the value is available to the object, or `false` if it is not. If you want to check for the existence of properties without necessarily checking their value, this task is well suited for that purpose.

## Properties

| Input  | Type   | Description                                               |
| ------ | ------ | --------------------------------------------------------- |
| `obj`  | Object | Required. The object to test.                             |
| `prop` | String | Required. The string that contains the property to check. |

| Output   | Type    | Description                                                                  |
| -------- | ------- | ---------------------------------------------------------------------------- |
| `result` | Boolean | Returns `true` if the object owns the specified property; `false` otherwise. |

## Example 1

In this example, the incoming reference variable for `prop` is "name" and the outgoing `result` returns `true`, indicating the object contains the specified property.

![](/_fern-img/adfd918c315048f35d71df8af39c6b3a07d892b4c87eed2a835334e43056283f.webp)![](/_fern-img/7f5a62893fbc131e2758017ade9ca45b9ddb19ba835bbf849e8f1b5f37a43a29.webp)

## Example 2

In this example, the incoming reference variable for `prop` is "type" and the `result` returns `false`, indicating the object does not contain that given property.

![](/_fern-img/a107bee613d482e88a617c5f36c83a16fb0e9794048bdd20e25f4353a309d1e3.webp)![](/_fern-img/d01092eaab14c8e303a974cc06bd97efb3cb318aeabe81cf8009ee9140598aed.webp)