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];
相关文章
相关标签/搜索