'Blue Whale'.includes('blue') // returns false
const string = "foo"; const substring = "oo"; console.log(string.includes(substring));
var str = "Hello world, welcome to the universe."; var n = str.includes("world");
const pets = ['cat', 'dog', 'bat']; console.log(pets.includes('cat')); // output: true
var str = "We got a poop cleanup on isle 4."; if(str.indexOf("poop") !== -1){ alert("Not again"); }
if (your_string.indexOf('hello') > -1) { alert("hello found inside your_string"); }
let storyWords = ['extremely literally actually hi bye okay'] let unnecessaryWords = ['extremely', 'literally', 'actually' ]; let betterWords = storyWords.filter(function(word) { return !unnecessaryWords.includes(word); }); console.log(betterWords) // ['hi' 'bye' 'okay]