Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianc/942545 to your computer and use it in GitHub Desktop.
Save brianc/942545 to your computer and use it in GitHub Desktop.
Classical Inheritance in JS
TinyOOP = {
mixin: function(target, other) { for(var key in other) { target[key] = other[key] }; return target },
class: function(parent, definition) {
var klass = parent.subclass(definition);
},
ClassMethods: {
subclass: function(definition) {
return TinyOOP.Class(this, definition);
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment