Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Javascript array of array loop

let myArray = [{"child": ["one", "two", "three", "four"]}, 
{"child": ["five", "six", "seven", "eight"]}];
for(let i = 0; i < myArray.length; i++){ 
let childArray = myArray[i].child; 
for(let j = 0; j < childArray.length; j++){ 
console.log(childArray[j]); 
}
}/* Outputs:onetwothreefourfivesixseveneight*/
Source by love2dev.com #
 
PREVIOUS NEXT
Tagged: #Javascript #array #array #loop
ADD COMMENT
Topic
Name
7+1 =