One option is to use a regular expression instead:
/Word1|Word2|Word3/.test(string)
Or iterate over an array of words to search for:
var found = false; var arr = ['Word1', 'Word2', 'Word3'] for (var i = 0; i < arr.length; i++) { if (string.indexOf(arr[i]) !== -1) { found = true; break; } } // use `found` variable
If you want to ensure that the string doesn't contain any of those words with a regex, then continually match characters from the beginning of the string to the end while using negative lookahead for the alternated pattern:
^(?:(?!Word1|Word2|Word3)[\s\S])+$
https://regex101.com/r/FsChvB/1
But that's strange, it'd be a lot easier just to use the same test as above, and invert it.
var stringContainsForbiddenWords = !/Word1|Word2|Word3/.test(string)