回答編集履歴

2

chousei

2022/09/28 10:05

投稿

yambejp
yambejp

スコア114883

test CHANGED
@@ -7,5 +7,5 @@
7
7
  ```
8
8
  ちゃんとやるなら
9
9
  ```javascript
10
- const result = keyword.filter(x=>types.filter(y=>new RegExp(x).test(y)).length);
10
+ const result = keyword.filter(x=>types.some(y=>new RegExp(x).test(y)));
11
11
  ```

1

chousei

2022/09/28 09:58

投稿

yambejp
yambejp

スコア114883

test CHANGED
@@ -5,3 +5,7 @@
5
5
  const result = keyword.filter(x=>new RegExp(x).test(types.join('__sepalator__')));
6
6
  console.log(result);//["天気", "よい"]
7
7
  ```
8
+ ちゃんとやるなら
9
+ ```javascript
10
+ const result = keyword.filter(x=>types.filter(y=>new RegExp(x).test(y)).length);
11
+ ```