Created
July 16, 2014 18:18
-
-
Save ortense/62a93635745d6772e296 to your computer and use it in GitHub Desktop.
My JS Constructor/Class template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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