format
typescript
List.Insert(index, item)class: List
description
Inserts an element at the specified index position in the list.
parameter
| param_name | type | description |
|---|---|---|
| index | number | The index value. |
| item | T | The element value. |
reture
| type | description |
|---|---|
void |
code example
typescript
let list = new List<Number>(Number);
list.AddRange([100, 200]);
//Inserts the value 300 at index position 2
list.Insert(2,300);
for (let index = 0; index < list.count; index++) {
Debug.Log(list.get(index));
}