if i use fetch to iterate an array in javascript code example
Example 1: javascript loop through array
const array1 = ['a', 'b', 'c'];
array1.forEach(element => console.log(element));
Example 2: how to iterate in array of array
var printArray = function(arr) {
if ( typeof(arr) == "object") {
for (var i = 0; i < arr.length; i++) {
printArray(arr[i]);
}
}
else document.write(arr);
}
printArray(parentArray);