My JS Constructor/Class template
var Constructor_name = (function(){
/** CONSTRUCTOR **/
function Constructor_name (params) {
// body...
}
/** PRIVATE METHODS **/
var private_method = function (argument) {
// body...
}
/** PUBLIC METHODS **/
Constructor_name.prototype.public_method = function(argument) {
// body...
};
return Constructor_name;
})();
/** INSTANCE **/
var obj = new Constructor_name();