Last active
December 19, 2016 16:57
-
-
Save shotamatsuda/25567f766671e96b154bb7b0d0c5ec71 to your computer and use it in GitHub Desktop.
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
function Base() { | |
var privateVariable; | |
this._protectedVariable; | |
this.publicVariable; | |
function privateFunction() {} | |
} | |
Base.prototype._protectedFunction = function () {}; | |
Base.prototype.publicFunction = function () {}; | |
function Derived() { | |
Base.call(this) | |
} | |
Derived.prototype = Object.create(Base.prototype); | |
Derived.prototype.constructor = Derived; | |
Derived.prototype._protectedFunction = function () { | |
Base.prototype._protectedFunction.call(this) | |
}; | |
Derived.prototype.publicFunction = function () { | |
Base.prototype.publicFunction.call(this) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment