Tell us what’s happening:
Hello,
I can’t figure out what’s the error could be. Please see error section below.
Your help is greatly appreciated.
Thank you
Chinh
Error:
// running tests
joinDogFraternity should use the constructor property.
// tests completed
// console output
Your code so far
function Dog(name) {
this.name = name;
}
// Add your code below this line
function joinDogFraternity(candidate) {
return candidate.constructor === Dog
}
let dog = new Dog('mydog')
console.log(joinDogFraternity(dog))
console.log(dog.constructor === Dog)
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4039.0 Safari/537.36
.
Challenge: Understand the Constructor Property
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-constructor-property