Created
March 11, 2011 16:13
-
-
Save tkiley/866103 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 Foo() { | |
var my_private; | |
this.get_my_private = function() { return my_private; } | |
this.set_my_private = function(newval) { my_private = newval; } | |
} | |
x = new Foo(); | |
x.set_my_private("this is a test private value"); | |
x.get_my_private(); | |
x.my_private; // this is undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment