Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript function loop through array

//function arrayLooper will loop through the planets array
const planets = ["Mercury", "Venus", "Earth", "Mars"];

const arrayLooper = (array) => {
  for (let i = 0; i < array.length; i++) {
    console.log(array[i]);
  }
};
arrayLooper(planets);
Source by www.codegrepper.com #
 
PREVIOUS NEXT
Tagged: #javascript #function #loop #array
ADD COMMENT
Topic
Name
7+3 =