# not

Takes a function $$f$$ , and returns a new one receiving a value $$val$$ and returning the opposite of what $$f(val)$$ would have returned.

It is largely used within the library itself.

{% code title="contains.js" %}

```javascript
/* Part of the contains validator */


const contains = (value) => compose(
  when(isString, (string) => string.includes(value)),
  when(Array.isArray, arrayContains(value)),
  when(not(or(isString, Array.isArray)), stubFalse),
);
```

{% endcode %}

#### Related validators

{% content-ref url="compose" %}
[compose](https://antonioru.gitbook.io/deep-waters/composition/compose)
{% endcontent-ref %}

{% content-ref url="when" %}
[when](https://antonioru.gitbook.io/deep-waters/composition/when)
{% endcontent-ref %}

{% content-ref url="or" %}
[or](https://antonioru.gitbook.io/deep-waters/composition/or)
{% endcontent-ref %}

�


---

# 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/composition/not.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.
