if (substrings.some(v => str.includes(v))) {
// There's at least one
}
var paragraph = "some things never change";
var substrings = ["random", "never", "test"];
if(substrings.some(s => paragraph.includes(s))) {
console.log("substring found")
} else {
console.log("NOT FOUND");
}
output: substring found
Take not that The includes() method performs a case-sensitive search to determine whether one string may be found within another string, returning true or false as appropriate.