title: Javascript dynamic callback functions
body: <p>I am trying to design a function that will accept different functions as argument (callbacks). These functions can have different number of arguments. Is there a way I can execute the callback directly without bothering the number of arguments</p>
  
  <p>For example : </p>
  
  <pre><code>function displayDialog(callBack)
   {
                     callBack();
   };
  </code></pre>
  
  <p>This function can be executed as follwing:</p>
  
  <pre><code>displayDialog(myFunction);
  </code></pre>
  
  <p>Where myFunction is</p>
  
  <pre><code>function myFunction(){}
  </code></pre>
  
  <p>or function `myFunction(a,b){}</p>