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