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

# default

default(value, \[ctx])

## Effect

Set the return value of `validate` and `validateSilent`, when the detected value is `undefined | null`.

## Arguments

* `value` ***(\*)*** - The default return value of `validate` and `validateSilent`. It is recommended but not necessarily to be a boolean. When `value` is a function, then set the return value of `value` to be the default return value. *The function has a parameter: the original detected value - `undefined`or `null`.*
* `[ctx]` ***(\*) -*** The execution context if `value` is a function.

## Example

```javascript
const schema = racoon.boolean().default(false);
schema.validate(undefined); // pass, return: false
schema.validate(null); // pass, return: false
```
