Created
March 17, 2018 07:53
-
-
Save linx4200/5d1af681fe32ebec25fe6d1c26b471bf to your computer and use it in GitHub Desktop.
【继承】类式继承
This file contains hidden or 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
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