1var colors = ["red", "blue", "green"];
2var hasRed = colors.includes("red"); //true
3var hasYellow = colors.includes("yellow"); //false
1var fruits = ["Banana", "Orange", "Apple", "Mango"];
2
3var n = fruits.includes("Mango");
1const array1 = [1, 2, 3];
2
3console.log(array1.includes(2));
4// expected output: true
5
6const pets = ['cat', 'dog', 'bat'];
7
8console.log(pets.includes('cat'));
9// expected output: true
10
11console.log(pets.includes('at'));
12// expected output: false
1
2var fruits = ["Banana", "Orange", "Apple", "Mango"];
3var n = fruits.includes("Mango");
4