Invoke javascript function from string
<p>I have the following code in my javascript module, however this requires me to make the functions visible to the outside world.</p>

<pre><code>var mymodule = function() {
    var self = null,
        init = function () { 
            self = this; 
            $('.actionButton').click(function () {
        var worklistId = $(this).data('worklistid'),
            action = $(this).data('action');
        self[action] &amp;&amp; self[action](worklistId); //watchout methods marked as not used are used by this invocation
            })
        },
        send = function () {
             // some logic
        },
        finish = function () {
             // some logic
        },
        delete = function () {
             // some logic
        };

    return {
        init: init,
        send: send,
        finish: finish,
        delete: delete
    };
}();

mymodule.init();
</code></pre>

<p>So the only thing I want to return in my module is the init function. However when I do this I cant invoke the functions, because the object (self) only contains the init function visible on the outside. </p>

<pre><code>return {
    init: init
};
</code></pre>

<p>Is there any solution to invoke my functions like this without making them visible to the outside world? Please no if else statements, because my workflow is bigger then the 3 actions in this example. I want to make my module as closed as possible because this reduces the dependencies.</p>

<p><strong>Update</strong></p>

<p>Here is a updated jsfiddle with one of the proposed solutions, however this is giving me another issue. <a href="http://jsfiddle.net/marcofranssen/bU2Ke/" rel="nofollow">http://jsfiddle.net/marcofranssen/bU2Ke/</a></p>
