回答編集履歴
1
chousei
test
CHANGED
@@ -2,24 +2,18 @@
|
|
2
2
|
|
3
3
|
```javascript
|
4
4
|
|
5
|
-
|
5
|
+
const str="あおいいえ";
|
6
6
|
|
7
|
-
|
7
|
+
const pattern=/[あ-お]/g;
|
8
8
|
|
9
|
-
|
9
|
+
const kagyou=s=>String.fromCharCode(s.charCodeAt(0) + 9);
|
10
10
|
|
11
|
-
return String.fromCharCode(s.charCodeAt(0) + 9);
|
12
|
-
|
13
|
-
};
|
14
|
-
|
15
|
-
var sagyou=function(s){
|
16
|
-
|
17
|
-
|
11
|
+
const sagyou=s=>String.fromCharCode(s.charCodeAt(0) + 19);
|
18
|
-
|
19
|
-
};
|
20
12
|
|
21
13
|
console.log(str.replace(pattern,kagyou));
|
22
14
|
|
23
15
|
console.log(str.replace(pattern,sagyou));
|
24
16
|
|
17
|
+
|
18
|
+
|
25
19
|
```
|