iterating over multidimensional array

Solutions on MaxInterview for iterating over multidimensional array by the best coders in the world

showing results for - "iterating over multidimensional array"
Niko
29 Apr 2019
1let studentsData = [['Jack', 24], ['Sara', 23],];
2
3// iterating over the studentsData
4studentsData.forEach((student) => {
5    student.forEach((data) => {
6        console.log(data);
7    });
8});
Arisha
20 Oct 2017
1var cubes = [["string", "string"], ["string", "string"]];
2
3for(var i = 0; i < cubes.length; i++) {
4    for(var j = 0; j < cubes[i].length; j++) {
5        console.log(cubes[i][j]);
6    }
7}
8