Created
October 27, 2009 20:39
-
-
Save dolzenko/219936 to your computer and use it in GitHub Desktop.
Dead Simple JavaScript Class Pattern (jQuery compatible)
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 MyClass = function() { | |
var self = this; | |
$.extend(self, { | |
initialize: function(constructor_arg1, constructor_arg2) { | |
self.method(); | |
}, | |
method: function() { | |
} | |
// other methods below... | |
}); | |
self.initialize.apply(self, arguments); | |
return self; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment