25.) rabbit1 does not have an adjective


#1

How is the rabbit1 not getting an adjective through this process?


function rabbit1(adjective) {
this.adjective = "fluffy"
this.describeMyself = function() {
   console.log("I am a " + this.adjective + " rabbit");
    };


#2

Hi bibleman13

you missing one semicolon at the end: this.adjective = "fluffy"

and need one more of these at the bottom } .


#3

Thanks! Unfortunately this does not solve my problem... I still get Oops, try again. Make sure to give rabbit1 the adjective fluffy


#4

Can you post all of the code? Maybe this will make things clearer.


#5

very true! Here is the whole shabang :smiley:

function Rabbit(adjective) {
this.adjective = adjective;
this.describeMyself = function() {
console.log("I am a " + this.adjective + " rabbit");
};
}

// now we can easily make all of our rabbits
function rabbit1(adjective) {
this.adjective = "fluffy";
this.describeMyself = function() {
console.log("I am a " + this.adjective + " rabbit");
};
}
function rabbit2(adjective) {
this.adjective = "happy";
this.describeMyself = function() {
console.log("I am a " + this.adjective + " rabbit");
};
}
function rabbit3(adjective) {
this.adjective = "sleepy";
this.describeMyself = function() {
console.log("I am a " + this.adjective + " rabbit");
};
}


#6

I think this discussion would help:


#7

Thanks that did solve my problem and pass the test but I do get three lines on the console.log of I am undefined bunny so I was wondering what technical error I made now? should my console statement be inside my describeMyself? Or something else?

function Rabbit(adjective) {
this.adjective = adjective;
this.describeMyself = function() {
console.log("I am a " + this.adjective + " rabbit");
};
}
rabbit1 = new Rabbit("fluffy");
rabbit1.describeMyself();
console.log("I am a " + this.adjective + " rabbit");
rabbit2 = new Rabbit("happy");
rabbit2.describeMyself();
console.log("I am a " + this.adjective + " rabbit");
rabbit3 = new Rabbit("sleepy");
rabbit3.describeMyself();
console.log("I am a " + this.adjective + " rabbit");


#8

The describeMyself function already contains a console.log and should display a result to the console. You don't need another console.log statement after calling each new rabbit.


#9

Thank you very much! I had my suspicions on that too xD


#10

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