> 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/smallerthan.md).

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

{% content-ref url="/pages/-M6UnloZY4qZJrvG\_1Pr" %}
[between](/deep-waters/validators/between.md)
{% endcontent-ref %}

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/smallerthan.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.
