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

# object

object(\[config])

## Effect

Get a schema object of type object.

## Arguments

* `[config]` ***(Object)***  - The config that respects the structure of `object`.
  * `[config.prop]` ***(schema)***  - An enumerable key and the corresponding value should be a schema object declared by `racoon-js`. If the value is not a schema object, it will be ignored.

## Example

```javascript
const schema1 = racoon.object();
schema1.validate(1); // fail
schema1.validate([1, 2]); // fail
schema1.validate({}); // pass
schema1.validate({ prop: 1 }); // pass

const schema2 = racoon.object({
  name: racoon.string(),
  age: racoon.number()
});
schema2.validate({ name: 123, age: 20 }); // fail
schema2.validate({ name: 'abc', age: 20 }); // pass
```
