check whether string is in string[] js code example
Example 1: if string javascript
if (typeof myVar === 'string') { /* code */ };
Example 2: javascript string contains
var string = "foo",
var substring = "oo";
console.log(string.includes(substring));