28 Hello this is Dog


28. Hello? Yes, this is Dog

My code prints the correct lines in the console log, but it won't let me advance, with the error message, "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". But the lines do print correctly. My code is below. I've tried refreshing, but it doesn't help. Any thoughts?

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

var myDog = new Dog("dachshund");


Nevermind, I just re-typed the code and it worked now. I guess it was the comma?


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