Created
October 14, 2013 11:06
-
-
Save tatey/6974057 to your computer and use it in GitHub Desktop.
This file contains hidden or 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() { | |
this.myAttribute = 1; | |
return this; | |
}; | |
MyClass.classMethod = function() { | |
}; | |
MyClass.prototype.instancMethod = function() { | |
}; | |
// Instantiating a class | |
var instance = new MyClass(); | |
// Calling an instance method | |
instance.instanceMethod(); | |
// Calling a class method | |
MyClass.classMethod(); |
Author
tatey
commented
Oct 14, 2013
(function(global) {
var MyClass = function() {
return this;
};
global.MyClass = MyClass;
})(this);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment