📜  js 循环数组 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:43.297000             🧑  作者: Mango

代码示例6
//create an array like so:
var colors = ["red","blue","green"];

//you can loop through an array like this:
for (var i = 0; i < colors.length; i++) {
    console.log(colors[i]);
}