Tell us what’s happening:
**Your code so far**
function Dog(name) {
this.name = name;
}
Dog.prototype = {
// Only change code below this line
eat() {return "Eating"},
};
I have 2 questions
- Why does this return false?
let doggy1 = new Dog("Ruff");
console.log(doggy1.constructor === Dog) // return false
- Why do this works:
console.log(doggy1.eat());
but not this
console.log(doggy1.prototype.eat());
I thought since it’s a prototype property, it would make sense to have ‘prototype’ in their calls.
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0
Challenge: Change the Prototype to a New Object
Link to the challenge: