javascript includes

JavaScript
var string = "foo",
    substring = "oo";

console.log(string.includes(substring));'Blue Whale'.includes('blue')  // returns false
const string = "foo";
const substring = "oo";

console.log(string.includes(substring));var str = "We got a poop cleanup on isle 4.";
if(str.indexOf("poop") !== -1){
	alert("Not again");
}
//use indexOf (it returns position of substring or -1 if not found)const pets = ['cat', 'dog', 'bat'];

console.log(pets.includes('cat'));
// output: truevar fruits = ["Banana", "Orange", "Apple", "Mango"];
var n = fruits.includes("Mango");
 
Source

Also in JavaScript: