indexOf()
Table of Contents
Overview
The indexOf() function takes listVariable and searchElement as arguments. It returns the first occurrence index of searchElement in listVariable.
If searchElement is not found in listVariable, it returns -1.
Return Type
- Number
Syntax
Parameter | Description | Data type |
---|---|---|
<variable> | Variable which will contain the returned index number. | NUMBER |
<listVariable> | The list variable from which the index number of the element will be returned. | LIST |
<searchElement> | The element whose first occurrence will be checked in the list. | AS APPLICABLE |
Examples
firstIndex = listVar.indexOf("Creator"); //returns 0