Why cant I use the ternary operator in this case?

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

function Dog(name) {
this.name = name;
}

// Only change code below this line
function joinDogFraternity(candidate) {
candidate.constructor===Dog ? true:false;
}
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36

Challenge: Understand the Constructor Property

Link to the challenge:

Your function does not have a return statement, otherwise the ternary operator works fine.

Happy Coding!

1 Like