array.forEach( function(value , index , object) { });
value保存数组的值 index保存数组的索引 object保存数组本身
都可缺省
var arr=["我","爱","你"];
arr.forEach(function(value,index,object){
console.log("index: "+index+" value:"+value);
});
array.forEach( function(value , index , object) { });
value保存数组的值 index保存数组的索引 object保存数组本身
都可缺省
var arr=["我","爱","你"];
arr.forEach(function(value,index,object){
console.log("index: "+index+" value:"+value);
});