Rabbits make me mad


#1

Rabbits make me mad.

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);

var array = [rabbit1, rabbit2, rabbit3];

for (i=0, i<=2, i++) {array[i].describeMyself}

What's wrong?

Edit:
Silly me. Forgot the " "s.
Sorry. I don't know how to delete my reply! :expressionless:


25: Constructors in review
#2

Be sure to use string literals in the argument.


#3

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