format
typescript
List.IndexOf(val)class: List
description
Get the index value of the specified element.
parameter
| param_name | type | description |
|---|---|---|
| val | T | The value of the element. |
reture
| type | description |
|---|---|
number | The 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);