Skip to content

Instantly share code, notes, and snippets.

@jeffwhelpley
Created March 19, 2014 17:15
Show Gist options
  • Save jeffwhelpley/9646517 to your computer and use it in GitHub Desktop.
Save jeffwhelpley/9646517 to your computer and use it in GitHub Desktop.
JavaScript Multiple Inheritence
var Mom = function () {
this.skill = 'smart';
}
var Dad = function () {
this.interest = 'soccer'
}
Dad.prototype.getNickname = function () {
return 'the man';
}
var Kid = function () {
Mom.apply(this);
Dad.apply(this);
}
_.extend(Kid.prototype, Mom.prototype);
_.extend(Kid.prototype, Dad.prototype);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment