Having the following nested array
[[[0, 0], [0, 1], [0, 2], [0, 3], [0, 4], [0, 5]], [[1, 0], [1, 1], [1, 2], [1, 3], [1, 4], [1, 5]], [[2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [2, 5]], [[3, 0], [3, 1], [3, 2], [3, 3], [3, 4], [3, 5]], [[4, 0], [4, 1], [4, 2], [4, 3], [4, 4], [4, 5]], [[5, 0], [5, 1], [5, 2], [5, 3], [5, 4], [5, 5]]]
I'd like to remove subarray containers until it becomes a 2 dimensional array like:
[[0,0], [5,1], [5,4]...]
.flatten removes everything and I need to keep the groups of 2 within subarrays.
ais your array you say that you want to produce the array[[0,0], a[5][1], a[5][4]...]. What is the rule for constructing that array?[[0, 0], [0, 1], [0, 2]..., but you said it should be[[0,0], [5,1], [5,4]...]. Please explain.arr = [[ [0,0], [0,1]], [[0,2], [0,3]]]how can I produce the 4-element array[[0,0], [0,1], [0,2], [0,3]]". Note three things: 1) the example is complete (no "..."); 2) the example is no larger than necessary; and 3) I have assigned a variable (arr) to the input object, so readers can use that variable in their answers and comments without having to define it (not necessary for outputs).