Tell us what’s happening:
Describe your issue in detail here.
I keep getting ‘arr.indexof is not a function’ I’m completely lost!
**Your code so far**
function quickCheck(arr, elem) {
// Only change code below this line
arr.indexof(elem) >= 0 ? true : false;
// Only change code above this line
}
console.log(quickCheck(['squash', 'onions', 'shallots'], 'mushrooms'));
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.50
Challenge: Check For The Presence of an Element With indexOf()
Thanks for your help but including (‘elem’) with quotation still doesn’t work
assuming that was what you meant. Again thankyou though it is appreciated.
Thanks your correct, can’t believe i’ve missed that. Though I changed the code to (typeOf) it’s now saying undefined so I guess i’ll just ry and solve it from here thanks.
I’m not too clear on what information to glean from the link but that’s just me being very new to these things. Your suggestion was most appreciated thankyou.
That’s cool. I was just pointing you to where you could find the correct spelling for that method. When in doubt about a method (or a lot of JS) looking it up in the MDN docs is a good move. I do it all the time.