xxxxxxxxxx
var str = "Hello World";
var substring = "World";
if (str.indexOf(substring) !== -1) {
console.log("String contains the substring");
} else {
console.log("String does not contain the substring");
}
xxxxxxxxxx
if (str.indexOf("Yes") >= 0)
//case insensitive version
if (str.toLowerCase().indexOf("yes") >= 0)
xxxxxxxxxx
var a = 'how are you';
a.includes('are'); // will return true if string contains search term