Not working


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

var myDog = new Dog("dachshund");


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


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