Check for the presence of an element with indexOf() already solved but have a question

I have the following code below which is passing but when I console.log it I see all the false statements but not the true ones. Is my solution correct? Why is the console.log not showing which ones are returning true?

function quickCheck(arr, elem) {
  //console.log("arr:", arr);
  //console.log("elem:", elem);
  //console.log('-----end of array----')
  // change code below this line
  if (arr.indexOf(elem) > -1) {
    return true ;
  } else { 
    return false;
  }
  // change code above this line
}

// change code here to test different cases:
console.log(quickCheck(['squash', 'onions', 'shallots'], 'mushrooms'));

Can you add a link to the exercise and format your code?

You can hit preformatted text in your editor to format your code.