> For the complete documentation index, see [llms.txt](https://antonioru.gitbook.io/deep-waters/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://antonioru.gitbook.io/deep-waters/validators/between.md).

# 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 %}
