Creator Help

List - indexOf

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


The indexOf function returns the position of a specified element in the given list. The first element will be at index '0', the second element at "1" and so on.



The indexOf 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 a given element in the list


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

colors.indexOf("red");  // returns the index number "0"

colors.indexOf("green");  // returns the index number "2"


Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: