Skip to content

Instantly share code, notes, and snippets.

@tkheyfets
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