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

# 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"
}
```
