回答編集履歴
1
追記
answer
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
```javascript
|
2
2
|
const samples = [[0,1,2],[3,4,5],[6,7,8]];
|
3
|
-
const result = samples.map(x=>x.filter(x=>x%2==0))
|
3
|
+
const result = samples.map(x=>x.filter(x=>x%2==0));
|
4
4
|
console.log(result);
|
5
|
+
```
|
6
|
+
|
7
|
+
# 結果を一次配列で
|
8
|
+
```javascript
|
9
|
+
const samples = [[0,1,2],[3,4,5],[6,7,8]];
|
10
|
+
const result = samples.flat().filter(x=>x%2==0);
|
11
|
+
console.log(result);
|
5
12
|
```
|