Constructors In Review


So, the following code worked, but before it worked, Rabbit1, Rabbit2, and Rabbit3 all had capital R's. Why was that a problem? Thanks.

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


In this lesson the code-checker
is testing on the variables rabbit1, rabbit2 and rabbit3

The code-convention for a variable
starts with a lowercase-character
in javascript they use camel-style like carFactoryEntranceSecurity <---JavaScript code-convention


This worked for me:
var rabbit1 = new Rabbit ("fluffy");

var rabbit2 = new Rabbit ("happy");

var rabbit3 = new Rabbit ("sleepy");

PS: there is a closed topic that gives guidance on this.