# 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](https://antonioru.gitbook.io/deep-waters/type-validators/isnumber)
{% endcontent-ref %}

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

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