User-719153870 posted
Hi zhyanadil,
The filter method in JS is used to process arrays, and cannot operate on strings.
Press F12 to open the console and you will see the problem.
If you want to match the string, you can do like this:
let a = "kool"
var term = 'oo';
var search = new RegExp(term, 'i');
let b = search.test(a);
alert(b);
Hope this can help you.
Best Regard,
Yang Shen