# smallerThan

Takes a number *num* and return a new function that evaluates whether the received value is of type number and it's smaller than *num* (the one previously defined). \
The evaluation is **not inclusive**.

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

const cannotVote = smallerThan(18);

cannotVote(7) // → true
cannotVote(18); // → false
cannotVote(22); // → false
```

{% hint style="warning" %}
Please note, **smallerThan** returned function does not evaluate if the received value is an integer or a float, it only evaluates that it is bigger than the defined one. \
A good improvement for the **cannotVote** validator from the example above could be the following:
{% endhint %}

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

const cannotVote = compose(Number.isInteger, smallerThan(17));
```

#### Related validators

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

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

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