javascript loop array

// Using for loop
for (var i = 0; i < myArray.length; i++) {
  console.log(myArray[i]);
}

// Using forEach method
myArray.forEach(function(element) {
  console.log(element);
});

// Using for...of loop
for (let element of myArray) {
  console.log(element);
}