1var fruits = ["Banana", "Orange", "Apple", "Mango"];
2
3var n = fruits.includes("Mango"); // true
4
5var n = fruits.includes("Django"); // false
1function checkInput(input, words) {
2 return words.some(word => input.toLowerCase().includes(word.toLowerCase()));
3}
4
5console.log(checkInput('"Definitely," he said in a matter-of-fact tone.',
6["matter", "definitely"]));
1function checkInput(input, words) {
2 return words.some(word => new RegExp(word, "i").test(input));
3}
4
5console.log(checkInput('"Definitely," he said in a matter-of-fact tone.',
6["matter", "definitely"]));