How to loop through array in JavaScript

Arrays
By Jad Joubran · 
Last updated Feb 22, 2020
const people = ["Sam", "Alex", "Charlie"];

people.forEach(person => {
  console.log(person);
});
Sam
Alex
Charlie
JavaScript forEach on Learn JavaScript Blog