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

# allowInfinity

allowInfinity()

## Effect

This is similar to `allowNaN`. By default, `number` doesn't allow the detected value to be `Infinity`. If you want `Infinity` to be allowed, you should call `allowInfinity`.

## Arguments

None

## Example

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

const schema2 = racoon.number().allowInfinity();
schema1.validate(Infinity); // pass
schema1.validate(-Infinity); // pass
```
