Why does the }; go there and not at the very bottom?


#1

function Rabbit(adjective) {
this.adjective = adjective;
this.describeMyself = function() {
console.log("I am a " + this.adjective + " rabbit");
> };
}


#2

this.describeMyself is a method which uses the function key, and a function requires you to use semi colons throughout the whole code including the last curly bracket.

However, the method/function is inside the Rabbit Object and that does not require a semi colon at the end.


#3

As a side note, the answer to your question is more clear if the code is shown as code and not text. Indenting makes things more visual.

function Rabbit(adjective) {
   this.adjective = adjective;
   this.describeMyself = function() {
     console.log("I am a " + this.adjective + " rabbit");
   };
}

With this visual + the input datarockstar offered, I believe it's more clear why the semi-colon is necessary in that location.