回答編集履歴
3
余計だった変数を削除
test
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
fruits = ['いちご', 'りんご', 'バナナ', 'ピーチ'];
|
5
5
|
tmp = [];
|
6
6
|
|
7
|
-
fruits.map(function(value) {
|
7
|
+
fruits.map(function(value) { tmp.push(value); return tmp.join("/") })
|
8
8
|
|
9
9
|
// [ 'いちご', 'いちご/りんご', 'いちご/りんご/バナナ', 'いちご/りんご/バナナ/ピーチ' ]
|
10
10
|
```
|
2
改行
test
CHANGED
@@ -3,9 +3,10 @@
|
|
3
3
|
```js
|
4
4
|
fruits = ['いちご', 'りんご', 'バナナ', 'ピーチ'];
|
5
5
|
tmp = [];
|
6
|
+
|
6
7
|
fruits.map(function(value) { rt = value; tmp.push(value); return tmp.join("/") })
|
7
8
|
|
8
|
-
|
9
|
+
// [ 'いちご', 'いちご/りんご', 'いちご/りんご/バナナ', 'いちご/りんご/バナナ/ピーチ' ]
|
9
10
|
```
|
10
11
|
|
11
12
|
|
1
改行
test
CHANGED
@@ -3,7 +3,9 @@
|
|
3
3
|
```js
|
4
4
|
fruits = ['いちご', 'りんご', 'バナナ', 'ピーチ'];
|
5
5
|
tmp = [];
|
6
|
+
fruits.map(function(value) { rt = value; tmp.push(value); return tmp.join("/") })
|
7
|
+
|
6
|
-
|
8
|
+
# [ 'いちご', 'いちご/りんご', 'いちご/りんご/バナナ', 'いちご/りんご/バナナ/ピーチ' ]
|
7
9
|
```
|
8
10
|
|
9
11
|
|