js中map、filter用法

var a = [0, 2, 3, 4];
a = a.map(function (i) {

return i + 1;

}).filter(function (i) {
console.log(i)
return i % 2 != 0;
});
console.log(a); //3,5

原文地址:https://www.cnblogs.com/rockyan/p/8573736.html