%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)
}
arrayItem
arrayItem(Type): Type
Returns the type of the given array. This function fails if the input is not an Array type.
Introduced in DataWeave 2.3.0. Supported by Mule 4.3 and later.
Example
This example shows how arrayItem
behaves with different inputs.