Skip to content

format

typescript
List.IndexOf(val)

class: List

description

Get the index value of the specified element.

parameter

param_nametypedescription
valTThe value of the element.

reture

typedescription
numberThe index value.

code example

typescript
let list = new List<Number>(Number);
for(let i = 0; i<3; i++){
    list.Add(i);// Add elements to the list
}

let index = list.IndexOf(1);
Debug.Log("The index value of element 1 is: ",index);