---
schema_version: "1"
id: b6221ba7e15a519ee313bb0e09e11fcc58ead2ddc490f210dadb4248ab4f1abf
title: arrayItem
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/latest/dw-types-functions-arrayitem.md
canonical_url: https://docs.mulesoft.com/dataweave/latest/dw-types-functions-arrayitem
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 4404f00ad7daf8e5e2f03316375c1f94c098b90933953765c5b6beba2d57b93e
description: MuleSoft Documentation Site
release: "2.13"
latest: true
---
---
product: DataWeave
version: 2.13
is-latest-version: true
---

# arrayItem

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## arrayItem(t: Type): Type

Returns the type of the given array. This function fails if the input is not an Array type.

_Introduced in DataWeave version 2.3.0._

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>t</code></p></td><td><p>The type to check.</p></td></tr></tbody></table>

### Example

This example shows how `arrayItem` behaves with different inputs.

#### Source

```DataWeave
%dw 2.0
import * from dw::core::Types
type ArrayOfString = Array<String>
type ArrayOfNumber = Array<Number>
type ArrayOfAny = Array<Any>
type ArrayOfAnyDefault = Array
output application/json
---
{
   a: arrayItem(ArrayOfString),
   b: arrayItem(ArrayOfNumber),
   c: arrayItem(ArrayOfAny),
   d: arrayItem(ArrayOfAnyDefault)
}
```

#### Output

```Json
{
  "a": "String",
  "b": "Number",
  "c": "Any",
  "d": "Any"
}
```
