how to call function using name such as "function someName(){}"?
<p>I have a name of a private function in JavaScript as a string, how do I call that function?</p>

<pre><code>var test = function () {

    this.callFunction = function(index) {
        return this["func" + index]();
    }

    function func1() { }
    function func2() { }
    ...
    function funcN() { }
}

var obj = new test();
obj.callFunction(1);
</code></pre>
