My test isn't passing even though it return correct result

Tell us what’s happening:
Describe your issue in detail here.
this test isn’t passing:
quickCheck(["onions", "squash", "shallots"], "onions") should return true.

  **Your code so far**

function quickCheck(arr, elem) {
// Only change code below this line
return (arr.indexOf(elem) >= 1);
// 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.102 Safari/537.36

Challenge: Check For The Presence of an Element With indexOf()

Link to the challenge:

arrays are zero based indexing. Meaning “onions” is at index pos 0?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.