Accessing parameter of one function from another in javascript
<pre><code>var vehiclePage = (function(){
 // defined these 3 public variable. to share between zoomNoShowFee &amp; submitVehicle 
    this.obj;
    this.rate;
    this.idx;
    var setPara = function(o,t,i){
        this.obj = o;
        this.rate = t;
        this.idx = i;
    }
    return {
        zoomNoShowFee : function(o,t,i){
              // this is existing function. I need to access o,t,i inside submitVehicle function.
            setPara(o,t,i);  // wrote this private function to set values
        },
        submitVehicle : function(){
                   // here I need to access zommNoShowFee's parameter
                     alert(this.rate);
        }
    } // return
})();
vehiclePage.zoomNoShowFee(null,5,3);
vehiclePage.submitVehicle();  // getting undefined
</code></pre>

<p>zoomNoShowFee is already existing. Some other fellow developer wrote this. I want to use the values passed into zoomNoShowFee parameters inside submitVehicle.</p>

<p>For that I declared 3 public variables at the top and trying to store the values using setPara private function. so that I can access those public variables inside submitVehicle function.</p>

<p>But getting undefined when calling vehhiclePage.submitVehilce()</p>

<p>Fundamentally, I doing something wrong. But don't know where...</p>

<p>Thanks for any help...</p>
