Skip to main content

lastIndexOf (Function)

Function returns the index of the given value.

Syntax

<INT> list:lastIndexOf(<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:lastIndexOf(stockSymbols. `IBM`)

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