Created
September 19, 2016 18:50
-
-
Save dengjonathan/028a954a016a747448d715419730c7c4 to your computer and use it in GitHub Desktop.
superclass to subclass inheritance
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 Bee = function () { | |
Grub.call(this); | |
this.age = 5; | |
this.color = 'yellow'; | |
this.job = 'keep on growing'; | |
}; | |
Bee.prototype = Object.create(Grub.prototype); | |
Bee.prototype.constructor = Bee; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment