Check For The Presence of an Element With index

Tell us what’s happening:
I followed the solution for this but i want to further my grasp of the solution, can someone explain the syntax of the solution in detail as i have a general idea as to what’s going on but any additonal information would help.

Your code so far

function quickCheck(arr, elem) {
  // change code below this line
return arr.indexOf(elem)=== -1 ? false : true;
  // change code above this line

// change code here to test different cases:
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/71.0.3578.98 Safari/537.36.

Link to the challenge:

You mean the ternary Operator?

It goes like this
(Evaluate this) ? (If it is true execute this) : (else execute this)
In this case whatever is executed it is returned

Meaning "if elem has an index of -1 (Not included in the array), return false, else return true"

If you are not familiar with the ternary Operator you can solve this with an if … else statement

Understood thank you for the response i did some other research on this as well but you response was helpful.

It could also have been more simply just like this. It returns true if indexOf return a number different than -1 and false otherwise

return arr.indexOf(elem) >= 0;

Is even shorter.