> For the complete documentation index, see [llms.txt](https://racoon-js.gitbook.io/zh/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/zh/jie-kou-shuo-ming/string/enum.md).

# enum

enum(...values)

## 作用

限制被检测值为有限几个枚举值。

## 参数

* `...values` ***(Array\<string>)*** 允许被检测值出现的一系列枚举值

## 示例

```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
```
