I want to reverse a multidimensional array and have the code below so far:
currentPositionPieceValues: [[], [], [], [], [], [], [], []]
gameDetails.currentPositionPieceValues
.map(row => row.reverse())
.reverse();
This seems to flip it horizontally, but not vertically, if you see what I mean.
How can I get it to do both?
.mapis going to create a new array, not mutate the existing one (reverse, on the other hand, does mutate its array).reverse(), or the new array created by.map())