hi guys.what do i input on the console.log to print out the output of this challenge
**Your code so far**
function Dog(name) {
this.name = name;
}
Dog.prototype = {
numLegs: 4,
eat: function() {
console.log("bone bone bone")
},
describe: function() {
console.log("My name is " + this.name);
}
};
console.log()
**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:
The methods have logging built in to them. If you want to use them, you need to create an instance, and then you can use the methods:
const myDog = new Dog('Fido')
myDog.eat()
myDog.describe()
see what i did.went to lookup at w3schools.but still did no get it correctly myDog = new Dog(“Bruno”);
document.getElementById(“demo”).innerHTML = "My Dog is a " + myDog.dogName;
ILM
4
the property is name
, not dogName
system
Closed
6
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.