N
array = [ 1, 2, 3, 4, 5, 6 ];
for (index = 0; index < array.length; index++) {
console.log(array[index]);
}
N
var myStringArray = ["Hello","World"];
var arrayLength = myStringArray.length;
for (var i = 0; i < arrayLength; i++) {
console.log(myStringArray[i]);
//Do something
}
N
const array1 = ['a', 'b', 'c'];
array1.forEach(element => console.log(element));
N
const array = ["hello", "world"];
for (item of array) {
//DO THIS
}
N
let colors = ['red', 'green', 'blue'];
for (const color of colors){
console.log(color);
}