回答編集履歴
1
修正
test
CHANGED
@@ -14,23 +14,23 @@
|
|
14
14
|
|
15
15
|
const array = value.split("");
|
16
16
|
|
17
|
-
const result: string = array.reduce((
|
17
|
+
const result: string = array.reduce((res: string, ch: string): string => {
|
18
18
|
|
19
19
|
if(ch==query1){
|
20
20
|
|
21
|
-
return
|
21
|
+
return res+"<ab>" + ch + "<ab>";
|
22
22
|
|
23
23
|
}else if(ch==query2){
|
24
24
|
|
25
|
-
return
|
25
|
+
return res+"<bc>" + ch + "<bc>";
|
26
26
|
|
27
27
|
}else if(ch==query3){
|
28
28
|
|
29
|
-
return
|
29
|
+
return res+"<ca>" + ch + "<ca>";
|
30
30
|
|
31
31
|
}
|
32
32
|
|
33
|
-
return
|
33
|
+
return res+ch;
|
34
34
|
|
35
35
|
}, "");
|
36
36
|
|