Answers for "Iterating over Multidimensional Array"

0

Iterating over Multidimensional Array

let studentsData = [['Jack', 24], ['Sara', 23],];

// iterating over the studentsData
studentsData.forEach((student) => {
    student.forEach((data) => {
        console.log(data);
    });
});
Posted by: Guest on June-27-2021
0

Iterating over a multidimensional array

var cubes = [["string", "string"], ["string", "string"]];

for(var i = 0; i < cubes.length; i++) {
    for(var j = 0; j < cubes[i].length; j++) {
        console.log(cubes[i][j]);
    }
}
Posted by: Guest on June-21-2021

Code answers related to "Iterating over Multidimensional Array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language