回答編集履歴

1

修正

2021/02/17 18:12

投稿

modieu
modieu

スコア282

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