At first, make sure that the string that you pass to indexOf is an actual string:
typeof <your-string-variable> === 'string'
To check if a string is in your list I suggest using ES6 Array.prototype.includes() :
['a', 'b', 'c'].includes('b')
To check if a string is a substring of the strings in your list combine Array.prototype.includes()method with String.prototype.includes() method:
(I also used ES6 reduce there to simplify the expression)
['hello', 'world', 'my', 'name', 'is', 'johny', 'cash'].reduce((current, item) => current || item.includes('substring_to_search'), false);
Hope this helps :-)