Insert Into List At Index
Inserts an item into the list at a certain index and returns the list.

Description
The Insert Into List At Index block inserts an item into the list at a certain index and returns the list. This is a code block part of the Lists drawer.
Usage
Use Insert Into List At Index to add elements at specific positions within a list. This is useful for maintaining ordered lists, inserting values at calculated positions, or building lists dynamically with precise control over element placement.
Syntax
Inputs:
- Any type of element/block to insert
- A list to insert into
- A number (the index position)
Notes
- Returns the modified list with the new element inserted
- Elements after the insertion point are shifted to higher indices
- The original list is modified and returned
- List indices in StarLogo Nova start at 1
Related Blocks
- List - Creates a list with specified elements
- Remove item number from - Removes an item at a specific index
- Splice list into list at index - Inserts multiple items from one list into another
- Item number in - Returns the item at a specific index