{oldarr[1]。forEach(E2 = & gt;{oldarr[2]。forEach(E3 = & gt;{new arr[i++]= e 1+E2+E3" />
當前位置:成語大全網 - 書法字典 - js數組如何合並生成壹個新數組?

js數組如何合並生成壹個新數組?

var oldarr=

[

["1","2","3"],

["4","5","6"],

["7","8","9"]

];

var new arr =[];

設I = 0;

oldarr[0]。forEach(e1= >{

oldarr[1]。forEach(E2 = & gt;{

oldarr[2]。forEach(E3 = & gt;{

new arr[i++]= e 1+E2+E3;

})

})

});

console . log(JSON . stringify(new arr));