JS 數組遍歷

一、foreach變量概念數組 var arr=[1,3,5,7,9]; //數組的元素,當前下標,數組自身 arr.forEach(function (item,index,arr) { console.log(item,index,arr); }) 二、foreach求和dom var arr=[1,3,5,7,9];
相關文章
相關標籤/搜索