js中的map函数

方便数组操作,返回处理后的数组

三个参数:当前元素,当前元素下标,当前map的数组

arr = [{ a: 1 }, { a: 2 }, { a: 3 }];
arr.map( (arg, arg2, arg3) => { console.log(arg,arg2,arg3);return arg['a']})

猜你喜欢

转载自www.cnblogs.com/guofan/p/9579686.html
今日推荐