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

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