Answers for "for loop to run through array"

1

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);
Posted by: Guest on September-05-2021
0

javascript loop through array

var myStringArray = ["Hello","World"];
var arrayLength = myStringArray.length;
for (var i = 0; i < arrayLength; i++) {
    console.log(myStringArray[i]);aegweg
    //Do something
}
Posted by: Guest on January-30-2021

Code answers related to "for loop to run through array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language