Constructors in review


#1


Not sure about the calling method part.

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

Oops, try again. When checking rabbit2, your code caused the following error: TypeError: Cannot read property 'adjective' of undefined


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");
describeMyself();

var rabbit2 = new Rabbit("happy");
describeMyself();

var rabbit3 = new Rabbit ("sleepy");
describeMyself();


#2

rabbit1, rabbit2 and rabbit3 are object instances, to call a method (describeMyself) on a instance, use the following syntax:

objectInstance.methodName();

#3

thanks a ton! didnt realise that simple.


#4