Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
Is there a way to get the interval using the this method?

So, imagine the following code below:

setInterval(() => {
    var thisInterval = this;
    fn1();
    fn2();
    if(someMouseDownEventDeclaredSomewhereElse){
        clearInterval(thisInterval);
    }
},100);

Is this the correct method for getting the current interval? Say I wanna do so without setting a variable to this loop because I want it to be an unnamed and non-stored interval. In simpler words: Is there a way to get an unnamed interval from within, like with this or something?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can do something like this;

function f() {
    fn1();
    fn2();
    if(!someMouseDownEventDeclaredSomewhereElse){
        setTimeout(f, 100);
    }
}
setTimeout(f, 100);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!