Skip to content

InsertAt

Void InsertAt(Array<ObjectType> array, ObjectType? element, Int index)

System · system operation · implicitly imported

Inserts an element into an array at the given index.

Parameters

  • Array<ObjectType> array — The array to insert into.
  • ObjectType? element — The element to insert.
  • Int index — The index to insert the element at.

Returns

Void — Returns no value.

Errors

A runtime type error if index is not an Int, or element is not compatible with the element type of array. A runtime error if a nested array would make array multi-dimensional.

See Also