title: Allowing javascript function to accept any number of arguments
body: <p>I would like the below function to be more flexible and accept multiple callbacks to other functions if they are defined in the arguments.</p>
  
  <pre><code>$(function() {
      function icisDashBox(colorElem, thisWidth, thisHeight, completeCallBack) {
          $(colorElem).colorbox({
          transition: 'none',
          innerWidth: thisWidth,
          innerHeight: thisHeight,
          opacity: '0.5',
          onOpen: function() { 
  
          },
          onLoad: function() { 
  
          },
          onComplete:function() { 
              $('#cboxLoadedContent').wrap('&lt;div id="icis_dialog_msg" /&gt;'); 
  
              completeCallBack();
  
          },
          onCleanup: function() { 
  
          },      
          onClosed: function() {
              $('#cboxLoadedContent').unwrap(); 
          }
      });
  }
  
  icisDashBox('.example9', '500', '500', completeFunction);
  
  function completeFunction() {
  
      var fooClass = $("#colorbox").addClass("FOO");
  
      var barClass = $("#colorbox").addClass("BAR");
  
      var ajaxCnt = $.ajax({
          type: "GET",
          url: "http://www.payso.me.uk",
          dataType: "html",
          success: function(data) {
              $("#colorbox").addClass("AJAX SUCCESS");
          }
      });
  
      return {
          x : fooClass,
          y : barClass,
          z : ajaxCnt                         
      };
  }
  </code></pre>
  
  <p>So in an ideal world my function would look like this without explicitly declaring any arguments:</p>
  
  <pre><code>function icisDashBox() { function code here }
  </code></pre>
  
  <p>Is this possible?  Also if the arguments are not defined how do i handle that?</p>
  
  <p>For example if one call to the function has several callbacks defined and another only has one is there a way of handling the lack of presence of callbacks.</p>
  
  <p>Cheers,</p>
  
  <p>:)</p>