# hasProp

Takes a string defining a property name and returns a new function evaluation whether the received value (*can be of any type*) exists and has the defined property.

```javascript
import hasProp from 'deep-waters/hasProp';

const hasLength = hasProp('length');

hasLength({ length: true }); // → true
hasLength("Hello"); // → true
hasLength([1, 2, 3]); // → true
hasLength({ prop: 1 }); // → false
```

{% hint style="warning" %}
hasProp does not evaluate whether the received value is strictly of type [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object), it only makes sure it has the defined property
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://antonioru.gitbook.io/deep-waters/validators/hasprop.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
