java script string includes code example
Example 1: javascript string contains
var string = "foo",
substring = "oo";
console.log(string.includes(substring));
Example 2: string.contains javascript
let string = "This string contains pizza";
if(string.includes("pizza") {
console.log("It's pizza time!");
}