I don't find what I need on internet, or may be I don't use correct words, but here is my problem.
I have a string for exemple: Ok bot, show me the doc of the Foo program.
And there is my keywords: ["bot","doc", "show", "Foo"]
I want that if the string contains 3 keyword or more, my function will return a message for exemple
I have think about
var message = "Ok bot, show me the doc of the Foo program.";
var keywords = ["bot","doc","show","foo"];
if(keywords.indexOf(message) >=3 ){
console.log('ok I understand');
}
But it not works
Can someone help me please ?
Thank you