25 - I pass the lesson but the console doesn't log anything...?


#1


https://www.codecademy.com/courses/spencer-sandbox/3/6?curriculum_id=506324b3a7dffd00020bf661#


There are no error messages... that's the weird thing. It says I did it great, continue, but the method doesn't log anything. scratches head


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

var rabbit1 = new Rabbit ("fluffy");
var rabbit2 = new Rabbit ("happy");
var rabbit3 = new Rabbit ("sleepy");

rabbit1.describeMyself;
rabbit2.describeMyself;
rabbit3.describeMyself;
// now we can easily make all of our rabbits


#2

Hi

here is your error, you forgot the parentheses:

Hint:
And to call the method, we use the syntax:

objectName.methodName( );

And your code:

rabbit1.describeMyself;
rabbit2.describeMyself;
rabbit3.describeMyself;

It should be:

rabbit1.describeMyself();
rabbit2.describeMyself();
rabbit3.describeMyself();

#3

Thanks! :smile_cat: Here are some more characters to please the textbox....


#4

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