回答編集履歴
1
filter
test
CHANGED
@@ -13,3 +13,23 @@
|
|
13
13
|
console.log(array);
|
14
14
|
|
15
15
|
```
|
16
|
+
|
17
|
+
よく考えたらfilterしてもよかったですね
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
```javascript
|
22
|
+
|
23
|
+
let array = ['a','b','c','d','e'];
|
24
|
+
|
25
|
+
let deleteIndexList = [0,2,4];
|
26
|
+
|
27
|
+
array=array.filter(function(x,y){
|
28
|
+
|
29
|
+
return !deleteIndexList.includes(y);
|
30
|
+
|
31
|
+
});
|
32
|
+
|
33
|
+
console.log(array);
|
34
|
+
|
35
|
+
```
|