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 583197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:46:02+00:00 2026-05-13T14:46:02+00:00

i am wondering if i can do some cleanup routines that will auto grab

  • 0

i am wondering if i can do some cleanup routines that will auto grab timeouts / intervals. consider this:

var timeout = setInterval(function dimitar() {
    console.log("hi!");
}, 1000);

console.log(window);

i had a look through window and can’t find any reference to the function that’s been passed on. the reference to timeout is there, sure enough. so where does the function ‘live’ here? is it launching a new instance of the js interpreter to eval/run/keep the code? how can you access it in relation to the timeout uid?

i know i can curry the setInterval function and get it to always store the reference into an array which i can then loop through and clear, but am curious if there’s a natural way of doing this

  • 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-13T14:46:02+00:00Added an answer on May 13, 2026 at 2:46 pm

    so where does the function ‘live’ here?

    The timeout/interval queue is an internal implementation detail that’s not accessible to content JavaScript. It retains a reference to the function passed in to setInterval, but it’s not a reference that’s visible to you.

    Incidentally you should generally avoid using named inline function expressions. Although it’s probably OK in this example code, IE’s JScript has some serious basic bugs with them that can trip you up if you’re not careful. Stick to named function statements (function dimitar() { ... } ... setInterval(dimitar, 1000)) or anonymous inline function expressions (setInterval(function() { ... })).

    is it launching a new instance of the js interpreter to eval/run/keep the code?

    No, it’s the same interpreter and the queue could even be implemented in JavaScript. But the variables behind it are hidden away from the caller.

    how can you access it in relation to the timeout uid?

    The timeout ID is by design completely opaque. The only defined interface that can do anything with it is the clearTimeout/clearInterval call. There is no interface provided to get the function back from a timeout ID.

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

Sidebar

Related Questions

Just wondering whether an object can self-destruct. Consider this situation. An object that extends
Just wondering whether an object can self-destruct. Consider this situation. An object that extends
I am wondering if this can be done easily. I am doing some paypal
I'm wondering if someone can shed some light on how this effect is achieved?
I was wondering if i can get some help with this problem. Suppose I
As a continuation of this question I'm wondering if I can get some simple
I was wondering where I can find some information how IE8 actually handles xml
I'm now wondering whether we can make some sort of SSL server based on
I'm new to some of App Development and was wondering the following; How can
I'm wondering if someone can give some advice as to which is 'better'. Twitter-bootstrap

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.