25 doesn`t print the console.log?


#1

I have this peace of 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");

How can is use describeMyself because now it doesn`t print anything


#2

You must call describeMyself() on a Rabbit object...

rabbit1.describeMyself();

This will print out...

"I am a fluffy rabbit"


#3

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