Skip to content

Instantly share code, notes, and snippets.

@shotamatsuda
Last active December 19, 2016 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shotamatsuda/25567f766671e96b154bb7b0d0c5ec71 to your computer and use it in GitHub Desktop.
Save shotamatsuda/25567f766671e96b154bb7b0d0c5ec71 to your computer and use it in GitHub Desktop.
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