I have an array like this – (i do not know the length of this array in advance)
data: [[3, 1], [1, 1], [5, 1], [6, 1], [25, 1], [8, 2], [2, 3]]
how i can swap it so it becomes like this:
data: [[1, 3], [1, 1], [1, 5], [1, 6], [1, 25], [2, 8], [3, 2]]
Thanks!
Each element is an array, so you can apply reverse on it.