js-util

Home > rc-js-util > arrayInsertAtIndex

arrayInsertAtIndex() function

Modifies input array by inserting at given index.

Signature:

export declare function arrayInsertAtIndex<TItem>(items: TItem[], itemToInsert: TItem, insertAtIndex: number): void;

Parameters

Parameter Type Description
items TItem[] The array to modify.
itemToInsert TItem The thing to insert.
insertAtIndex number Where to insert it. Pun intended.

Returns:

void

Remarks

See arrayInsertAtIndex().