回答編集履歴

1

&& obj はよくみたら不要

2022/04/02 15:34

投稿

arcxor
arcxor

スコア2857

test CHANGED
@@ -16,6 +16,6 @@
16
16
 
17
17
  const st = new Set();
18
18
  objA.forEach(obj => st.add(obj.age));
19
- const ret = objB.filter(obj => st.has(obj.age) && obj);
19
+ const ret = objB.filter(obj => st.has(obj.age));
20
20
  console.log(ret);
21
21
  ```