js for loop of all item in an array code example
Example 1: javascript loop through array
const myArray = ['foo', 'bar'];
myArray.forEach(x => console.log(x));
//or
for(let i = 0; i < myArray.length; i++) {
console.log(myArray[i]);
}
Example 2: javascript iterate array
String[] myStringArray = {"Hello", "World"};
for (String s : myStringArray)
{
// Do something
}