回答編集履歴
2
テキスト修正
test
CHANGED
@@ -12,7 +12,19 @@
|
|
12
12
|
|
13
13
|
```javascript
|
14
14
|
|
15
|
+
let list = [
|
16
|
+
|
17
|
+
"13-10", "12-11", "13-11", "13-12", "12-12", "13-13",
|
18
|
+
|
19
|
+
"13-14", "13-15", "13-16", "13-17", "12-13"];
|
20
|
+
|
21
|
+
|
22
|
+
|
15
|
-
|
23
|
+
list = list.filter(e => e.startsWith('13-')); // => '13-' で始まる要素を抽出
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
console.log(list);
|
16
28
|
|
17
29
|
```
|
18
30
|
|
1
テキスト修正
test
CHANGED
@@ -15,3 +15,5 @@
|
|
15
15
|
const filteredList = list.filter(e => e.startsWith('13-'));
|
16
16
|
|
17
17
|
```
|
18
|
+
|
19
|
+
- **動作確認用 CodePen: **[https://codepen.io/jun68ykt/pen/ExaoZbd?editors=0012](https://codepen.io/jun68ykt/pen/ExaoZbd?editors=0012)
|