Answers for "loop through multidimensional array"

1

loop over twodimensional array python

array = [
  [2, 4, 5, 6],
  [6, 5, 99],
  [849, 33, 7, 7]
]

for i in array:
	for j in i:
      	print(j, end=", ")
        
# 2, 4, 5, 6, 6, 5, 99, 849, 33, 7, 7,
Posted by: Guest on March-18-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 "loop through multidimensional array"

Python Answers by Framework

Browse Popular Code Answers by Language