For example i have a array like that
var myArray = [
[1,2,3],
[4,5,6],
[7,8,9,10],
[[11,12],[13,14,15]]];
for (var i = 0;i < myArray.length;i++){
for(var j = 0 ;j< myArray[i].length;j++){
for(var k = 0;k< myArray[i][j].length;k++){
console.log(myArray[i],[j][k]);
}
}
}
But output is only 11,12,13,14,15. And i wanna print all the values Could some one help to fix Thank you in advance
x) that takes an array and iterates over the elements of that array. In the function test every element and if its an array callxwith that array....[1,2,3]is in the "second level" whereas[11,12]and[13,14,15]are in the "third level". So for instancemyArray[i][j].lengthwill beundefinedfori == 0