12/30


#1

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

// here we make buddy and teach him how to bark
var buddy = new Dog("Golden Retriever");
buddy.bark = function() {
console.log("Woof");
};
buddy.bark();

// here we make snoopy
var snoopy = new Dog("Beagle");
// we need you to teach snoopy how to bark here
buddy.bark = function(buddy)
// this causes an error, because snoopy doesn't know how to bark!
snoopy.bark();

Please help i get an Unexpected identifier


#2

Your problem area:

First of all, buddy.bark is already defined. Second, that isn't how you make a function.

I would say that you should make a snoopy.bark function, for buddy.bark is already used.

snoopy.bark = function(){
console.log(_____);
}

Then I believe that it will work.


#3

I did

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

// here we make buddy and teach him how to bark
var buddy = new Dog("Golden Retriever");
buddy.bark = function() {
  console.log("Woof");
};
buddy.bark();

// here we make snoopy
var snoopy = new Dog("Beagle");
// we need you to teach snoopy how to bark here
snoopy.bark = function(){console.log("Woof");};
// this causes an error, because snoopy doesn't know how to bark!
snoopy.bark();

#4

the coding you have making the mention
is no no making the very working for me.