Creator Help

List - lastIndexOf

This topic describes the syntax and usage of the list - lastIndexOf function in Zoho Creator .


The  lastIndexOf function returns the position of the last occurence of the element in the list. The first element will be at index '0', the second element at "1" and so on.



The lastIndexOf function syntax has the following arguments.

list - Required - The list from which you want to get the index of the element.

element- Required. The element to be searched for.

Return Value

Returns the position of the last occurance of the element in the list.


colors = {"red", "blue", "green", "red", "yellow", "blue"};

x = list1.lastIndexOf("red");         // returns the index number 3