数组的各种遍历方法和jQuery中的each方法
1.forEach,some,map,filter遍历数组/*
* 数组的forEach方法:
* 1、返回给回调的参数先是值,然后是下标
* 2、回调函数执行时内部的this指向window
* */
/*var arry = [1,2,3,4,5];
arry.forEach(function( val, index ) {
console.log( val, index, this );
})
翻译
2017-04-07 18:26:07 ·
746 阅读 ·
0 评论