Constructors in review (Needs Debugging)


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 = Rabbit("fluffy");
var rabbit2 = Rabbit("happy");
var rabbit3 = Rabbit("sleepy");


You need to use your constructor you made at the top, do this by using the keyword new before each rabbit. After you do that you need to call the describeMyself function after each rabbit. describeMyself();.


Hey! Thanks again! You're a lifesaver!


All good, there were no bugs in this code. Just remember that you wrote this code at the top for a reason :slight_smile:


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