Not working


#1

ReferenceError: breed is not defined

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 " + Dog[breed] + "dog");
}

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

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


#2

Right on this page you could press Ctrl+F to highlight all occurrences of that word and then consider if it's defined at each such place


#3

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