I have an array that looks something like this:
uint256[] array = [1,2,3,4,5,6,7,8];
I am familiar with how to add an element to an array using array.push(100);
which would make the array look like this:
[1,2,3,4,5,6,7,8,100];
How can I add an element to the array at an index of my choosing while altering the array size accordingly?
For instance, how do I add an element to the array at: index [3]
or more specific array[3] = 999
while also increasing the size of the array accordingly?
The desired result would look something like this:
[1,2,3,999,4,5,6,7,8,100];