数组 forEach map filter

forEach 

 

map

 

filter

var arr = [1,2,3,4,5,6,7];

var newArr = arr.filter(function(item, index, old) {
    return index % 3 === 0 || item > 3;
});
console.log(newArr, arr);

 

posted @ 2016-02-17 18:49  bronana  阅读(110)  评论(0编辑  收藏  举报