js string includes an array of options code example
Example 1: js string contains
var string = "foo";
var substring = "oo";
console.log(string.indexOf(substring) !== -1);
Example 2: javascript includes method getting 'hi' and 'high' problem
var str = 'hilly';
var value = str.includes('hi'); //true, even though the word 'hi' isn't found
var value = /\bhi\b/.test(str); //false - 'hi' appears but not as its own word