Created
March 19, 2014 17:15
-
-
Save jeffwhelpley/9646517 to your computer and use it in GitHub Desktop.
JavaScript Multiple Inheritence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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