lood through array code example
Example 1: how to iterate through an array in javascript
const array = ["one", "two", "three"]
array.forEach(function (item, index) {
console.log(item, index);
});
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>";
}