Help on "Constructors in Review"


Below is my code. It tells me that " When checking rabbit1, 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 Rabbit1("fluffy");
var rabbit2 = new Rabbit2("happy");
var rabbit3 = new Rabbit3("sleepy");


There is just the one constructor function, Rabbit(). Use it in all three instances.


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