Printing Methods To The Console


#1

On Introduction to Objects I - exercise 25, I am having trouble with the last step. I am suppose to,

"Use the method describeMyself to print out in the console a sentence about each object you just created!Use the method describeMyself to print out in the console a sentence about each object you just created!"

I am not sure how to do this. Here is my code.

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

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

console.log(describeMyself());

#2

Simply do rabbit1.describeMyself();


#3

Thanks a lot, that worked. I use to be really bad at objects when I first learned them, but then I got better. I still have trouble with them sometimes.