Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

two dimensional array traversing in javascript

const numbers = [
  [1, 2, 3],
  [4, 5, 6],
  [7, 8, 9, 10, 11],
];

for (let i = 0; i < numbers.length; i++) {
  for (let j = 0; j < numbers[i].length; j++) {
    console.log(`Index Point [${i}, ${j}], value = ${numbers[i][j]}`);
  }
}
 
PREVIOUS NEXT
Tagged: #dimensional #array #traversing #javascript
ADD COMMENT
Topic
Name
8+9 =