回答編集履歴
2
ちょうせい
test
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
// var arr3 = arr1.map((x,y)=>x+" "+arr2[y]);
|
8
8
|
|
9
|
-
var arr3 = arr1.
|
9
|
+
var arr3 = arr1.reduce((x,y,z)=>(x.push(`${y} ${arr2[z]}`),x),[]);
|
10
10
|
|
11
11
|
console.log(arr3);
|
12
12
|
|
1
chousei
test
CHANGED
@@ -4,7 +4,9 @@
|
|
4
4
|
|
5
5
|
var arr2 = ['Taro', 'Ichiro', 'Ken'];
|
6
6
|
|
7
|
-
var arr3 = arr1.map((x,y)=>x+" "+arr2[y]);
|
7
|
+
// var arr3 = arr1.map((x,y)=>x+" "+arr2[y]);
|
8
|
+
|
9
|
+
var arr3 = arr1.map((x,y)=>[x,arr2[y]].join(' '));
|
8
10
|
|
9
11
|
console.log(arr3);
|
10
12
|
|