%dw 2.0
output application/json
---
{
present: ["a","b","c","d"] indexOf "c",
notPresent: ["x","w","x"] indexOf "c",
presentMoreThanOnce: ["a","b","c","c"] indexOf "c",
}
indexOf
indexOf(array: Array, value: Any): Number
Returns the index of the first occurrence of the specified element in this array, or -1
if this list does not contain the element.
Introduced in DataWeave version 2.4.0.