Dynamically add/remove function while calling one single function using parameters
<p>I have a function called f0 having some parameters. When i call it, it calls some other functions with some parameters(for example the same parameters).
The problem is, can i add somehow these functions dynamically?</p>

<p>A simple solution would be something like this:</p>

<pre><code>var callf1=true;
var callf2=true;
var callf3=true;

function f1(params){
//some code
}
function f2(params){
//some other code
}
function f3(params){
//some code
}

function f0(params){
    if(callf1){
      f1();
    }
    if(callf2){
      f1();
    }
    if(callf3){
      f1();
    }

}

function mymain(){
    f0(params);
}

setInterval("mymain()",5000);
</code></pre>

<p>This option is much time consuming because every time it has to check the variables. Could i use somehow the trigger option in JQuery using runtime and giving parameters?</p>

<p>I would be glad if you can recommend me an easier and simpler solution.</p>
