javascript in array

JavaScript
var colors = ["red", "blue", "green"];
var hasRed = colors.includes("red"); //true
var hasYellow = colors.includes("yellow"); //falsevar fruits = ["Banana", "Orange", "Apple", "Mango"];

var n = fruits.includes("Mango");var myList=["a", "b", "c"];
mylist.includes("d")//returns true or false[1, 2, 3].includes(2);     // true
[1, 2, 3].includes(4);     // false
[1, 2, 3].includes(3, 3);  // false
[1, 2, 3].includes(3, -1); // true
[1, 2, NaN].includes(NaN); // truevar fruits = ["Banana", "Orange", "Apple", "Mango"];
var n = fruits.includes("Mango");
 const array1 = [1, 2, 3];

console.log(array1.includes(2));
// expected output: true

const pets = ['cat', 'dog', 'bat'];

console.log(pets.includes('cat'));
// expected output: true

console.log(pets.includes('at'));
// expected output: false
Source

Also in JavaScript: