Created
December 8, 2013 21:31
-
-
Save daogurtsov/7864095 to your computer and use it in GitHub Desktop.
javascipt basic mixin
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
Object.prototype.mixin = function(module) { | |
for (method in module.prototype) { | |
if (module.prototype.hasOwnProperty(method)) | |
this.prototype[method] = module.prototype[method] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment