vararr1=["a","b"];vararr2=["A","B"];vararr3=["1","2"];想得到arr=["a_A","a_B","a_1","a_2","b_A","b_B","b_1","b_2","A_1","A_2","B_1","b_2"];和arr=["a_A_1","a_A_2","a_B_1","a_B_2","b_A_1","b_A_2","b_B_1","b_B_2"];请问怎么写?
2 回答
慕仙森
TA贡献1827条经验 获得超7个赞
varnewArr1=arr1.map((v,i)=>{returnarr1[i]+"_"+arr2[i];});varnewArr2=arr1.map((v,i)=>{returnarr1[i]+"_"+arr2[i]+"_"+arr3[i];});
添加回答
举报
0/150
提交
取消