這樣的數(shù)組:
let a=this.moneyApplyInfo.amount;
let b=this.moneyApplyInfo.companyNames;
this.companyMoneyList=a.map((o,i)=>{
return [o,b[i]]
});
后臺打印出的合成后的數(shù)據(jù):
如果是多個數(shù)組:
let a=['公司A','公司B','公司C']
let b=['1100','2200','3300']
let c=['張三','李四','王五']
let d?=?a.map((o,i)=>{
?return? [o,b[i],c[i]]
})
返回數(shù)據(jù):d=[ ['公司A','1100','張三'],['公司B','2200','李四'],['公司C','3300','王五'] ]