let arr = [1,2,3,4,5];
//方法一
for(let index=0;index<arr.length;index++){
console.log("方法一:" + arr[index]);
}
//方法二
for(index in arr){
console.log("方法二:" + arr[index]);
}
//方法三
arr.forEach(function(item,index){
console.log("方法三:" + item);
});
//方法四
arr.map(function(ele,index){
console.log("方法四:" + ele);
});
//方法五
for(let ele of arr){
console.log("方法五:" + ele);
}