Hey guys,
I've been wondering about this one for a while. One way I particularly like to structure my code is like this:
systemName.moduleName = new function() {
var $this = this;
$this.__construct = function() {
// Something here
}
$this.someOtherMethod = function() {
// Something else here
}
$this.__construct();
}
As I feel it makes the code easier to read, allows me to keep it flatter, and I always have access to the this var within the scope of the module (I do a lot of my development in jQuery, so there's often a lot of nested functions).
Anyway, my specific question is whether or not it's semantically correct to include a semi-colon after the closing brace for those function declarations.
From my own perspective, there's an equal argument for and against it.
The argument for: It's a variable declaration
Argument against: It's also a function declaration
Thoughts anyone?