Skip to content

Instantly share code, notes, and snippets.

@linx4200
Created March 17, 2018 07:53
Show Gist options
  • Save linx4200/5d1af681fe32ebec25fe6d1c26b471bf to your computer and use it in GitHub Desktop.
Save linx4200/5d1af681fe32ebec25fe6d1c26b471bf to your computer and use it in GitHub Desktop.
【继承】类式继承
function SuperClass(params) {
this.superValue = true;
}
SuperClass.prototype.getSuperValue = function() {
return this.superValue;
}
function SubClass () {
this.subValue = false;
}
SubClass.prototype = new SuperClass();
SubClass.prototype.getSubValue = function () {
return this.subValue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment