Skip to main content

$$indexof

Find the index of the first element that matches the specified value.

Usage​

{ 
"$$indexof": /* Array of elements */,
"of": /* any */
}
"$$indexof(<of>):{input}"

Returns​

number

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
InputarrayYesArray of elements
ofanyYesThe value to look for

Examples​

Input

Definition

Output

[
"A",
"B",
"C"
]
{
"$$indexof": "$",
"of": "B"
}
1
[
"A",
"B",
"C"
]
{
"$$indexof": "$",
"of": "D"
}
-1
[
"A",
"B",
"C"
]
"$$indexof(B):$"
1
[
"A",
"B",
"C"
]
"$$indexof(D):$"
-1