Tell us what’s happening:
Your code so far
function quickCheck(arr, elem) {
// Only change code below this line
if (arr.indexOf(elem) = -1) {
return false
}
else {return true}
// Only change code above this line
}
console.log(quickCheck([‘squash’, ‘onions’, ‘shallots’], ‘mushrooms’));
function quickCheck(arr, elem) {
// Only change code below this line
quickCheck.indexOf()
// Only change code above this line
}
console.log(quickCheck(['squash', 'onions', 'shallots'], 'mushrooms'));
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15
.
Challenge: Check For The Presence of an Element With indexOf()
Link to the challenge: