Powered By GitBook
INDEX_OF
Get index of item in list

Description

Returns the first index at which a given item can be found in the source list.
If the given item cannot be found, null is returned instead.

Function signature

1
INDEX_OF(values: Array, item: ) => Number
Copied!
Parameter
Description
Values
List
Item
Item to locate in the list

Examples

1
numbers = [1,2,3]
2
complexArray = [1,0,2,"test",null,null,[1,2,3],{"a":10},[],{},false,true]
Copied!
Formula
Return value
INDEX_OF(numbers, 1)
0
INDEX_OF(numbers, 2)
1
INDEX_OF(numbers, null)
null
INDEX_OF(complexArray, 0)
1
INDEX_OF(complexArray, "test")
3
INDEX_OF(complexArray, true)
11
INDEX_OF(complexArray, [])
8
INDEX_OF(complexArray, [1, 2, 3])
6
INDEX_OF(complexArray, {})
9
INDEX_OF(complexArray, { a: 10 })
7
Last modified 10mo ago
Export as PDF
Copy link