Skip to content

Instantly share code, notes, and snippets.

@dengjonathan
Created September 19, 2016 18:50
Show Gist options
  • Save dengjonathan/028a954a016a747448d715419730c7c4 to your computer and use it in GitHub Desktop.
Save dengjonathan/028a954a016a747448d715419730c7c4 to your computer and use it in GitHub Desktop.
superclass to subclass inheritance
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