前端和vue各种循环数组的写法:

var arr = [ "one", "two", "three", "four"];     
 $.each(arr, function(){     
    alert(this);     
 });   
//上面这个each输出的结果分别为:one,two,three,four    
var arr1 = [[1, 4, 3], [4, 6, 6], [7, 20, 9]]     
$.each(arr1, function(i, item){     
   alert(item[0]);     
});  

使用for循环:
var arrf = [1, 2, 3, 4, 5];  
for (var i = 0; i < arrf.length; i++) {  
  console.log(777722, i, arrf[i]);  
}

forEach方法:
var arrf = [1, 2, 3, 4, 5];  
arrf.forEach(function(vv, ii) {  
  console.log(777722, ii, vv);  
});

使用for...of循环(ES6+):
var arrf = [1, 2, 3, 4, 5];  
let index = 0;  
for (const vv of arrf) {  
  console.log(777722, index, vv);  
  index++;  
}