Skip to main content

indexOf (Function)

Function returns the last index of the given element.

Syntax

<INT> list:indexOf(<OBJECT> list, <OBJECT|INT|LONG|FLOAT|DOUBLE|BOOL|STRING> value)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
listThe list to be checked to get index of an element.OBJECTNoYes
valueValue for which last index needs to be identified.OBJECT INT LONG FLOAT DOUBLE BOOL STRINGNoYes

Example 1

list:indexOf(stockSymbols. `IBM`)

Returns the last index of the element IBM if present else it returns -1.