Skip to content

Instantly share code, notes, and snippets.

@christopherscott
Created February 11, 2013 22:13
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 christopherscott/4758095 to your computer and use it in GitHub Desktop.
Save christopherscott/4758095 to your computer and use it in GitHub Desktop.
var Lib2 = {
extend: function (props) {
var sub = Object.create(this);
sub = mixin(sub, props);
sub.super = this;
return sub;
}
};
var Person = Lib.extend({
init: function (name) {
this.name = name;
},
speak: function () {
console.log(this.name);
}
});
var Employee = Person.extend({
work: function () {
console.log(this.name + ' is working');
}
});
var d = Employee.extend();
d.init('chris');
d.speak();
d.work();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment