I am new to programming and I have just worked out a multidimensional array problem by using pure javascript but I think I made it too complicated and just wondering can anyone tell me how do you think about my method and do you have a better way to do it. the problem is to console.log all the numbers in the arrays and the array is [[[1,2],[3,4]],[[5,6]]]. My code is as below, please post your suggestions,thanks
var nestedArr = [[[1,2],[3,4]],[[5,6]]];
var nestedArrOne = nestedArr[0];
var nestedArrTwo = nestedArr[1];
var newArr = nestedArrOne.concat(nestedArrTwo);
function showAll(){
for(var i=0; i<newArr.length; i++){
for(var j=0; j<newArr[i].length; j++){
console.log(newArr[i][j]);
}
}
}
showAll();