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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:31:08+00:00 2026-06-09T17:31:08+00:00

I am analyzing some code from a book I am reading and there is

  • 0

I am analyzing some code from a book I am reading and there is a small piece that confuses me a little bit:

//... some code

setTimeout(function(){
   //...some code
   if(some condition)
      setTimeout(arguments.callee, 0);
}, 0);

What is a little confusing for me is that the same book mentions that the “callee” property has been deprecated and that it should not be used unless strictly necessary (I am paraphrasing). So I am wondering if this is one of those cases or if there could be a better way to accomplish the recursive call. Somewhere on the internet I read that the following may accomplish the same thing:

//... some code

setTimeout(function myRecursiveFunction(){
   //...some code
   if(some condition)
      setTimeout(myRecursiveFunction, 0);
}, 0);

Is this correct? Is there yet a better way to approach this? Is it safe and ok to keep using arguments.callee?

Thank you for any clarification.

  • 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-06-09T17:31:09+00:00Added an answer on June 9, 2026 at 5:31 pm

    The second approach is best. What it actually does is it “hoists” the function declaration to the top of the nearest enclosing scope (the function in which this was defined), and names the function “myRecursiveFunction”.

    The alternative would be creating an anonymous scope like so:

    setTimeout(
        (function(){
            var myRecursiveFunction = function() {
                console.log(myRecursiveFunction);
            };
            return myRecursiveFunction
        }),
        1000
    )
    

    or perhaps using a fixedpoint combinator from functional programming.

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

Sidebar

Related Questions

I'm analyzing some code that utilizes empty OVER clauses in the contest of Count().
I am analyzing some .net desktop application. I have found that code: if (System.Environment.ProcessorCount
I am kinda new to this Regex thing. When analyzing some code I frequently
I found this line of code in some code I'm analyzing: Mintau = (double*)
I am writing C code, in which I am analyzing some data. I have
Is there any way how to call JQuery function from PageLoad C# file? Basically
I'm analyzing some legacy code. It is about 80.000 lines of old plsql code.
I'm analyzing some old SQL code in a stored procedure. Declare @Var1 money, @Var2
well I am analyzing a javascript code, but I got confuse in some lines,
I'm analyzing some code and I'm looking for string literals, to check if I

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.