const myArray = ["Harry", "Ron", "Hermione", "Tom"];
for(let i = 0; i < myArray.length; i++) {
console.log(myArray[i]);
}
/* output
Harry
Ron
Hermione
Tom
*/
//FOR OF LOOP
let MyArray = ["Harry", "Ron", "Hermione", "Tom"];
for(const arrayItem of MyArray) {
console.log(arrayItem)
}
/* output
Harry
Ron
Hermione
Tom
*/