I passed a function(which itself has a parameter) as a parameter into another function and how to get the parameter
<p>I passed a function(which itself has a parameter let's say para) as a parameter into another function function b() and how to get the parameter para.</p>

<p>here is the simple example</p>

<pre><code>&lt;input type="button" onclick="sometest3()" value="Run test"&gt;

&lt;script&gt;
function sometest3() {

    // pass an anonymous function as a parameter which has
    // its own parameter "client"
    sometest('connection',function(client){client.getInfo();}) 
}


function sometest(eve,func) {

     // get this function's parameter which is "client" and pass
     // a reference of sometest2 to it. so in the callback I can use
     client.getInfo(); 
}


function sometest2() {
   this.getInfo=function (){alert("get it");};
}
&lt;/script&gt;
</code></pre>
