Answers for "can you iterate over an 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

iterate through array javascript

foreach ($objects as $obj) {
   echo $obj->property;
}
Posted by: Guest on May-15-2020

Code answers related to "can you iterate over an array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language