Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Yan Nesting For Loops

const arr = [
  [1, 2], [3, 4], [5, 6]
];

for (let i = 0; i < arr.length; i++) {
  for (let j = 0; j < arr[i].length; j++) {
    console.log(arr[i][j]);
  }
}
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #Yan #Nesting #For #Loops
ADD COMMENT
Topic
Name
5+8 =