Ok, so I have a array like this.
myArray:Array []
myArray.push(Object) // x 4.
I have 4 objects in my array. Then I splice the second one. Leaving me with a array that looks like this. 1,3,4. Now… I would like to have this array look like this: 1,2,3. I Would like the 3 & 4 to simple switch place to one less from their own postion.
I know it’s possible, I had a friend do it for me some years ago. How do I do this?
So…just
pop()the last element:Umm…that’s exactly what deleting the second element already did…
If the end result you want is that the second element be placed at the end, that is:
Then you can do that in two steps:
Technically you could do this in one step, since the splice will happen first: