回答編集履歴
1
テキスト修正
answer
CHANGED
@@ -10,4 +10,13 @@
|
|
10
10
|
|
11
11
|
- **動作確認用CodePen:** [https://codepen.io/jun68ykt/pen/LYEGMYx?editors=0012](https://codepen.io/jun68ykt/pen/LYEGMYx?editors=0012)
|
12
12
|
|
13
|
-
参考になれば幸いです。
|
13
|
+
参考になれば幸いです。
|
14
|
+
|
15
|
+
### 追記
|
16
|
+
|
17
|
+
`containsSingleChar(str)` の別案です。ただし、引数が空文字列の場合、`true` を返します。
|
18
|
+
|
19
|
+
```javascript
|
20
|
+
containsSingleChar = str => [...str].every(e => e === str[0]);
|
21
|
+
```
|
22
|
+
- **動作確認用CodePen:** [https://codepen.io/jun68ykt/pen/PowZXrv?editors=0012](https://codepen.io/jun68ykt/pen/PowZXrv?editors=0012)
|