> For the complete documentation index, see [llms.txt](https://racoon-js.gitbook.io/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://racoon-js.gitbook.io/en/api/number/allownan.md).

# allowNaN

allowNaN()

## Effect

By default, `number` doesn't allow the detected value to be `NaN`. If you want `NaN` to be allowed, you should call `allowNaN`.

> **NOTE**
>
> If you call both `allowNaN` and `required`, the effect is up to `required`, means `NaN` is not allowed.

## Arguments

None

## **Example**

```javascript
const schema1 = racoon.number();
schema1.validate(NaN); // fail

const schema2 = racoon.number().allowNaN();
schema2.validate(NaN); // pass

const schema3 = racoon.number().allowNaN().required();
schema3.validate(NaN); // fail
```
