format
typescript
List.get(index)class: List
description
Get the value of an element based on its index (index starts from 0).
parameter
| param_name | type | description |
|---|---|---|
| index | number | The index of the element. |
reture
| type | description |
|---|---|
T|undefined | The value of the element. |
code example
typescript
let list = new List<Number>(Number);
for(let i = 0; i<3; i++){
list.Add(i);// Add elements to the list
}
for (let index = 0; index < list.count; index++) {
Debug.Log(list.get(index));// Output the elements in the list
}