Code is executing but an error message is showing up

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 ' + [breed] + ' dog');

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

var myDog = new Dog("dachshund");

what's wrong with those code, please help, it's actually executing, but the console is giving me this error message :

" ReferenceError: breed is not defined "

why is that?


That function has no such variable. Perhaps the object has an attribute by that name?