javascript encapsulation - any way to access a private member given instance?
<p>Is it possible to access a private member in javascript given an instance variable?  For example,</p>

<pre><code>function class Foo() {
   var x=12;
   // some other stuff
}
F = new Foo();
// how to get/set F.x?
</code></pre>

<p>Update: as a twist, suppose that the class has a privileged method.  Is it possible to hijack that privileged method to access a private member?</p>

<pre><code>function class Foo() {
   var x=12, y=0;
   this.bar = function(){ y=y+1; }
}
F = new Foo();
// can I modify Foo.bar to access F.x?
</code></pre>
