Skip to content

format

typescript
List.InsertRange(index, objects)

class: List

description

Inserts a group of elements at the specified index position in the list.

parameter

param_nametypedescription
indexnumberThe index value.
objectsT[]List<T>The group of elements.

reture

typedescription
void

code example

typescript
let list = new List<Number>(Number);
list.AddRange([100, 200]);
// Insert the group of elements [10,20] at index 0
list.InsertRange(0,[10,20]);

for (let index = 0; index < list.count; index++) {
    Debug.Log(list.get(index));
}