Skip to content

Instantly share code, notes, and snippets.

@tkheyfets
Last active March 18, 2016 23:55
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 tkheyfets/e4f24f38e9cec9e5d4b3 to your computer and use it in GitHub Desktop.
Save tkheyfets/e4f24f38e9cec9e5d4b3 to your computer and use it in GitHub Desktop.
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