Access variables from functions
<p>I'm C# developer who is trying to use object oriented programing in javascripts. For the following code</p>

<pre><code>var np =  np || {};

 np.Class1 = function () {

    var var1,
        var2,
        var3;

    var init = function(a) {
        var1 = a;
        this.var2 = a;
        init3(a);
    };

    var init3 = function(b) {
        this.var3 = b;
    };

    return {
        init: init,
        var1: var1,
        var2: var2,
        var3: var3
    };
};

var t = new np.Class1();
t.init("t");
console.log("var1 " + t.var1);
console.log("var2 " + t.var2);
console.log("var3 " + t.var3);
</code></pre>

<p>I'm getting:</p>

<pre><code> var1 undefined 
 var2 t 
 var3 undefined 
</code></pre>

<p>The only way which I can get to private variables in <code>Class1</code> is to use <code>this.var2 = a;</code> but it is not working for function which is call from other function. How can I access to private variables from function <code>init3()</code>?</p>

<p>Edited</p>

<p>Even if I change function <code>init3()</code> like this</p>

<pre><code>var init3 = function(b) {
  var3 = b;
};
</code></pre>

<p>the result is the same. So question is still valid. How can I manipulate private variables from function?</p>
