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'));