js looping throug array code example
Example 1: javascript loop and array
var array = ["hello","world"];
array.forEach(item=>{
console.log(item);
});
Example 2: iterate over array javascript
var txt = "";
var numbers = [45, 4, 9, 16, 25];
numbers.forEach(myFunction);
function myFunction(value, index, array) {
txt = txt + value + "<br>";
}