Source Code:
(back to article)
Submit
Result:
Report an issue
var myArray = ["Rose", "Lily", "Daisy", "Jasmine"]; if (myArray.indexOf(searchTerm) === -1) { console.log("element doesn't exist"); } else { console.log("element found"); }