Specifically in JavaScript, when does one use a semicolon and when do you not.
Here is an example snippet of code;
function Drawable() {
this.init = function(x, y) {
this.x = x;
this.y = y;
}
this.speed = 0;
this.canvasWidth = 0;
this.canvasHeight = 0;
this.draw = function() {
};
}
Can someone enlighten me as to why
this.init = function(x,y) {}
does not end with a semicolon, however
this.draw = function(){};
does end with a semicolon in the above snippet of code?