# stripUnkown

## 作用

当调用`allowUnkown()`允许未知属性后，返回结果默认将会保留未知属性及其值，若要剪除，则需要调用`stripUnkown`.

> **说明**
>
> 如果你已经调用了`stripUnkown`, 则可不必调用`allowUnkown`, 因为`stripUnkown`包含了`allowKnown`的功能。

## 参数

无

## 示例

```javascript
const schema1 = racoon.object({
  name: racoon.string()
}).allowUnkown();
const result1 = schema1.validate({
  name: 'Jack',
  age: 22
}); // pass, and result1 is { name: 'Jack', age: 22 }

const schema2 = racoon.object({
  name: racoon.string()
}).allowUnkown().stripUnkown();
const result2 = schema2.validate({
  name: 'Jack',
  age: 22
}); // pass, and result1 is { name: 'Jack' }
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://racoon-js.gitbook.io/zh/jie-kou-shuo-ming/object/stripunkown.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
