Here is an example array: Arr1 = [1,1,2,2,3,8,4,6]
.
I'm trying to divide this array into two new arrays based on the odd or even position of elements. Can anyone provide a solution?
New Array 1 (odd positions): [1,2,3,4]
New Array 2 (even positions): [1,2,8,6]