javascript string contain word code example
Example 1: javascript string contains function
s = "Hello world";
console.log(s.includes("world"));
Example 2: js check if string contains character
"FooBar".includes("oo"); // true
"FooBar".includes("foo"); // false
"FooBar".includes("oo", 2); // false