I need to compare titles (which are made of many words) with a list of bad words. For one word, indexOf works fine. but when there are many swear words it doesn't.
Can anyone help with this?
var title = "This is my title";
var badwordlist = title.indexOf('fword and other bad words list');
//var badwordlist = title.indexOf('fword');
if ( badwordlist >= 0){
//do something
}