how to loops through an array code example
Example 1: javascript loop through array
var myStringArray = ["Hello","World"];
var arrayLength = myStringArray.length;
for (var i = 0; i < arrayLength; i++) {
console.log(myStringArray[i]);
//Do something
}
Example 2: javascript loop through array
const array = [1, 2, 3, 4];
for(num of array) {
console.log(num);
}