Access "private" variables in prototype
<p>Is it possible in JavaScript to create a private variable which can be accessed in prototype? I tried the following which <a href="http://jsfiddle.net/TBfk4/" rel="nofollow">obviously doesn't work</a>, because <code>bar</code> is only accessible from within <code>Foo</code>  and not from within prototype.</p>

<pre><code>function Foo() {
    var bar = 'test';
}

Foo.prototype.baz = function() {
    console.log(bar);
};
</code></pre>

<p>I know I also cannot use <code>this.bar = 'test'</code>, because that would make <a href="http://jsfiddle.net/KrAXh/" rel="nofollow">the property public</a> AFAIK. How to make the <code>bar</code> variable private, but accessible by prototype?</p>
