Source Code: (back to article)
var myArray = ["Rose", "Lily", "Daisy", "Jasmine"];

if (myArray.indexOf(searchTerm) === -1) {
console.log("element doesn't exist");
}
else {
console.log("element found");
}