var array1 = ["one","two","three"]; var array2 = ["1","2","3"]; var arr=[]; array1.forEach((currentValue,index)=>arr.push([currentValue,array2[index]])); 传统一点: var array1 = ["one","two","three"]; var array2 = ["1","2","3"]; var arrayAll=[]; for(let i=0;i<array1.length;i++){ arrayAll.push([array1[i],array2[i]]) }
自行合并咯,想怎么合都行
看到楼上的,突然想到类似的操作
var array1 = ["one","two","three"];
var array2 = ["1","2","3"];
var arr=[];
array1.forEach((currentValue,index)=>arr.push([currentValue,array2[index]]));
传统一点:
var array1 = ["one","two","three"];
var array2 = ["1","2","3"];
var arrayAll=[];
for(let i=0;i<array1.length;i++){
arrayAll.push([array1[i],array2[i]])
}