摘要: var arr = [1,3,2,5,3];//forEach 两个参数,第一个为数组内容,第二个为数组下标arr.forEach(function(item,index) { console.log(index + ' ' +item);})//map 遍历数组进行计算操作var newArr = arr.map(function(item,index) { return item*2;... 阅读全文
posted @ 2018-12-22 15:11 ysyblue 阅读(385) 评论(0) 推荐(0) 编辑