1 var fruits = ["Apple", "Banana", "Mango", "Orange", "Papaya"];
2
3 // Check if a value exists in the fruits array
4 if(fruits.indexOf("Mango") !== -1){
5 alert("Value exists!")
6 } else{
7 alert("Value does not exists!")
8 }