%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(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.
Example
This example shows how arrayItem
behaves with different inputs.