# between

Takes a two numbers, *min* and *max,* and return a new function evaluating whether the received value is of included between *min* and *max*. (the one previously defined). \
The evaluation is **not inclusive**.

{% hint style="info" %}
The **between** validator is a [curried](https://en.wikipedia.org/wiki/Currying) function
{% endhint %}

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

const isTeen = between(10)(19);

isTeen(17) // → true
isTeen(22); // → false
isTeen(7); // → false
```

{% hint style="warning" %}
Please note, **between** returned functions does not evaluate if the received values are of type integer or float.\
A good improvement for the **isTeen** validator from the example above could be the following:
{% endhint %}

```javascript
import compose from 'deep-waters/compose';
import between from 'deep-waters/between';

const isTeen = compose(Number.isInteger, between(10)(19));
```

#### Related validators

{% content-ref url="/pages/-M6URCQydxMlZza07hsY" %}
[isNumber](/deep-waters/type-validators/isnumber.md)
{% endcontent-ref %}

{% content-ref url="/pages/-M6Uoz8L9u2rTM7hz1LC" %}
[biggerThan](/deep-waters/validators/biggerthan.md)
{% endcontent-ref %}

{% content-ref url="/pages/-M6Up3bgtgL0xGtys1XK" %}
[smallerThan](/deep-waters/validators/smallerthan.md)
{% 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/validators/between.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.
