# What's the type of 'next' in ProsemirorModel content.js

**URL:** <https://discuss.prosemirror.net/t/whats-the-type-of-next-in-prosemirormodel-content-js/3008>\
**Category:** Show\
**Created:** [July 18, 2020, 9:26am UTC](https://discuss.prosemirror.net/t/whats-the-type-of-next-in-prosemirormodel-content-js/3008 "2020-07-18T09:26:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![herrdu](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/herrdu/32/1883_2.png) [@herrdu](https://discuss.prosemirror.net/u/herrdu)\
**Post date:** [July 18, 2020, 9:26am UTC](https://discuss.prosemirror.net/t/whats-the-type-of-next-in-prosemirormodel-content-js/3008/1 "2020-07-18T09:26:11Z")

</div>

Hey!

I am reading the code of content.js now . And I have a problem with the type of ’ next ’ .

 ![image](https://discuss.prosemirror.net/uploads/secondsite/original/2X/2/2523fa3c9250030eb973126f857aa50d7035889b.png)

It seems as `ContentMatch[]`, but in `matchType` method ,it looks like `NodeType[]`.

So which type is it.

---

<div class="post-metadata">

**Author:** ![herrdu](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/herrdu/32/1883_2.png) [@herrdu](https://discuss.prosemirror.net/u/herrdu)\
**Post date:** [July 18, 2020, 9:53am UTC](https://discuss.prosemirror.net/t/whats-the-type-of-next-in-prosemirormodel-content-js/3008/2 "2020-07-18T09:53:43Z")

</div>

我明白了，这里类型是

```auto
  /** 这里类型是 [NodeType, ContentMatch， NodeType, ContentMatch....] */
  next: Array<NodeType<S> | ContentMatch<S>>;
  /** 这类型是 [NodeType, NodeType[], NodeType, NodeType[]... ] */
  wrapCache: Array<NodeType<S> | Array<NodeType<S>>>;

```

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [July 18, 2020, 12:36pm UTC](https://discuss.prosemirror.net/t/whats-the-type-of-next-in-prosemirormodel-content-js/3008/3 "2020-07-18T12:36:15Z")

</div>

It’s an alternating array of `[NodeType, ContentMatch, NodeType, ContentMatch, ...]` elements. Hence the `i += 2` index increments.

---

<div class="post-metadata">

**Author:** ![herrdu](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/herrdu/32/1883_2.png) [@herrdu](https://discuss.prosemirror.net/u/herrdu)\
**Post date:** [July 18, 2020, 2:14pm UTC](https://discuss.prosemirror.net/t/whats-the-type-of-next-in-prosemirormodel-content-js/3008/4 "2020-07-18T14:14:19Z")

</div>

I got it. Thank you!
