I absolutely don’t understand the example code from this lesson.
Can some one please explain?
What is candidate.constructor ?
Your code so far
function Dog(name) {
this.name = name;
}
// Add your code below this line
function joinDogFraternity(candidate) {
if (candidate.constructor === Dog) {
return true;
} else {
return false;
}
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-constructor-property