Created
January 8, 2014 02:48
-
-
Save aredridel/8310945 to your computer and use it in GitHub Desktop.
A method for having a 'private method' in javascript.
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
module.exports = function Class() {} | |
Class.prototype.method = function () { | |
SomethingInternal.call(this) | |
} | |
function SomethingInternal() { | |
console.log("I'm internal, and I'm currently a method of", this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment