---
description: 'between :: Number → Number → a → Boolean'
---

# 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="../type-validators/isnumber" %}
[isnumber](../type-validators/isnumber)
{% endcontent-ref %}

{% content-ref url="biggerthan" %}
[biggerthan](biggerthan)
{% endcontent-ref %}

{% content-ref url="smallerthan" %}
[smallerthan](smallerthan)
{% endcontent-ref %}



