📌  相关文章
📜  在javascript代码示例中循环遍历数组

📅  最后修改于: 2022-03-11 15:01:45.246000             🧑  作者: Mango

代码示例6
//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);