title: Firefox setTimeout(func, ms) sending default parameters to callback
body: <p>I am unable to find out more about this default parameter that I ran across and was hoping that someone could point out an explanation.</p>
  
  <p>In Firefox (3.6 in this case) if you call the following code:</p>
  
  <pre><code>function test(someVar) {
     console.log('test ' + someVar);
  }
  setTimeout(test, 0);
  </code></pre>
  
  <p>It will log a "random" number to the console.  I know you can pass parameters in Firefox like so:</p>
  
  <pre><code>setTimeout(test, 0, param1, param2);
  </code></pre>
  
  <p>But it appears as though Firefox is automatically sending a value.  I <em>think</em> it's the number of ms past the requested call time but I cannot be certain.  (EG: now() + 0ms == now(), but since it can't call right now it waits for the execution queue and returns the number of ms past that time?)  If I put 500ms for the timeout it usually returns 0 unless I have a long running script behind it.</p>
  
  <p>I also know that Firefox will clamp timeout requests to 10ms and putting in 0 will make it default to 10ms.  If this value is a 'delay value' (ie: it took us 126ms longer than you requested) is it based on the value I enter(0) or the clamped min?</p>
  
  <hr>
  
  <p>One answer below suggests that this is the timer handle.  The following code disproves that(?):</p>
  
  <pre><code>function test(someVar) {
     console.log('test ' + someVar);
  }
  console.log('Timer ' + setTimeout(test, 0));
  </code></pre>
  
  <p>This will return two different values.</p>
  
  <hr>
  
  <p>Of course, it will return <code>undefined</code> in IE so I'm not writing code that expects it, but I was curious.</p>
  
  <p>(This actually was causing a bug in some code I was working on that relied on optional parameters for a calling function.  Worked in IE, not FF.)</p>