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 pets = ['cat', 'dog', 'bat'];
2
3console.log(pets.includes('cat'));
4// output: true
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
1let fruits = ["Banana", "Orange", "Apple", "Mango"];
2let do_contain = fruits.includes("Mango"); // contain: true