<!DOCTYPE html><html><head lang="en"><meta charset="UTF-8"><title></title></head><body><script>/*1.map():将一个数组映射为另一个数组并返回处理后的数组*/var list =[1,2,3,4,5,6];//map 映射返回修改之后的集合var newlist = list.map(function(value,index){
return value * value
});
console.log(newlist);
list.map(function(value, index){
console.log(value);});/* 2.reduce():将数组元素进行累计(从左到右)*/var num =[1,2,3,4];var number = num.reduce(function(all, value){
return all * value;});
console.log(number);/* 3.concat():将多个数组拼接并返回结果*/var a =[1,2];var b =[