javascript loop through array of strings number code example
Example 1: iterate through array javascript
const array = ["one", "two", "three"]
array.forEach(function (item, index) {
console.log(item, index);
});
Example 2: javascript loop through array
const array = [1, 2, 3, 4];
for(num of array) {
console.log(num);
}