Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4085514
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:35:23+00:00 2026-05-20T18:35:23+00:00

I am unable to find out more about this default parameter that I ran

  • 0

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.

In Firefox (3.6 in this case) if you call the following code:

function test(someVar) {
   console.log('test ' + someVar);
}
setTimeout(test, 0);

It will log a “random” number to the console. I know you can pass parameters in Firefox like so:

setTimeout(test, 0, param1, param2);

But it appears as though Firefox is automatically sending a value. I think 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.

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?


One answer below suggests that this is the timer handle. The following code disproves that(?):

function test(someVar) {
   console.log('test ' + someVar);
}
console.log('Timer ' + setTimeout(test, 0));

This will return two different values.


Of course, it will return undefined in IE so I’m not writing code that expects it, but I was curious.

(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.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:35:24+00:00Added an answer on May 20, 2026 at 6:35 pm

    From MDC

    Gecko passes an extra parameter to the
    callback routine, indicating the
    “lateness” of the timeout in
    milliseconds.

    Because the “actual” delay maybe longer than the delay specified in the setTimeoutcall, the “lateness” will be zero if the function was called exactly after the delay specified, non-zero otherwise.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been unable to find any info on this, which seems like it could
I want to find out more about NoSQL databases/data-stores available for use from Java,
Surprisingly I've been unable to find anyone else really doing this, but surely someone
I have been unable to find any decent documentation on this function. The code
I have been searching but unable to find a proper list. Can someone please
UPDATE: SOLUTION AT BOTTOM I'm hoping someone else has spent some time ironing out
I ran into a strange bug in my PHP web app that I'm unable
Unable to find a SQL diff tool that meets my needs, I am writing
I have been unable to find any documentation on the .build method in Rails
I have been unable to find any documentation on properly closing database connections in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.