I wonder if someone could help me out with the best way to approach this task.
I have a simple object array of unknown length, e.g.
Array := [Item1, Item2, Item3, Item4, Item5, Item6, Item7, Item8, Item9, Item10, Item11, Item12, Item13]
All the odd-numbered keys are complete garbage and I'd like to remove them from the array.
The output should be an array that only includes the even numbered keys from the original array.
Therefore, the output should be an array that contains these values:
Array := [Item2, Item4, Item6, Item8, Item10, Item12]
What would be the best approach for this?
1. Build a second array from the first array and delete the original.
2. Somehow delete the odd-numbered keys in a loop. I'm not sure that would work as the keys would shift after each iteration.
Many thanks for any pointers or help in achieving this.
