Skip to content

Instantly share code, notes, and snippets.

@ortense
Created July 16, 2014 18:18
Show Gist options
  • Save ortense/62a93635745d6772e296 to your computer and use it in GitHub Desktop.
Save ortense/62a93635745d6772e296 to your computer and use it in GitHub Desktop.
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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment