---
description: enum(...values)
---

# enum

## Effect

Restrict the detected string to be one of `values`.

## Arguments

* `...values` _**(Array\<string>)**_ - The valid values that allow the detected string to be.

## Example

```javascript
const schema = racoon.string().enum('a', 'b', 'c');
schema.validate('a'); // pass
schema.validate('b'); // pass
schema.validate('c'); // pass
schema.validate('d'); // fail
```
