Hello? yes this is doge


#1

...

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

// add the sayHello method to the Dog class
// so all dogs now can say hello
Dog.prototype.sayHello = function() {
console.log("Hello this is a " + this.breed + " dog")
}

var yourDog = new Dog("golden retriever");
yourDog.sayHello();

var myDog = new Dog("dachshund");
myDog.sayHello();

...

so my code works and I can move on to the next exercise, but nothing is logging on the console whats going on?


#2

I input your code in the console and it ran fine for me. Try restarting/using a different browser? I don't see any problems with it.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.