I found two questions that are practically the same:
How to insert an item into an array at a specific index?
How to push to an array in a particular position?
I thought about flagging the more recent one, but it already has an answer since 2012.
Is there any point in flagging a duplicate question that has had and answer for years?