Skip to content

Instantly share code, notes, and snippets.

@tkheyfets tkheyfets/oop.js
Last active Mar 18, 2016

Embed
What would you like to do?
function extend(Child, Parent) {
Child.prototype = Object.create(Parent.prototype);
Child.prototype.constructor = Child;
return Child;
}
var Message = function (text) {
this.text = text;
};
Message.prototype.send = function (to) {
//..
};
var Email = extend(function (text, from, to) {
//..
}, Message);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.