Yes, this is Dog


#1

It's printing correctly, but giving me an error. I've also refreshed the browser.

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

Oops, try again. It appears that your sayHello method doesn't properly log to the console 'Hello this is a [breed] dog' where [breed] is the breed of the Dog


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

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


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

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


#2

make sure the output string is exactly as expected. Even a full stop will change it


#3

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