28. Hello?


#1


https://www.codecademy.com/courses/objects-ii/5/2?curriculum_id=506324b3a7dffd00020bf661


Hello,
I wrote the code you see below, my code passes the test but doesn't print anything.
Have I done something wrong?

Thank you :slight_smile:

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();


#2

it seems fine,

maybe it is a bug.


#3

Ty once again enigmatike


#4

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