I know this question has been asked before but all of the answers assume the array is a 2D array and only go one level deep.
I have a 4D array and have tried some of the solutions here and did not get the result. Here's my array:
I tried this answer from this question but this only goes one level deep. How do I make it work with a 4D array?
var newArray = [];
for (var i = 0; i < currentArray.length; i++)
newArray[i] = currentArray[i].slice();