回答編集履歴
2
chousei
test
CHANGED
@@ -7,5 +7,5 @@
|
|
7
7
|
```
|
8
8
|
ちゃんとやるなら
|
9
9
|
```javascript
|
10
|
-
const result = keyword.filter(x=>types.
|
10
|
+
const result = keyword.filter(x=>types.some(y=>new RegExp(x).test(y)));
|
11
11
|
```
|
1
chousei
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
|
+
```
|