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

  • Home
  • SEARCH
  • 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 8448169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:21:17+00:00 2026-06-10T10:21:17+00:00

I have a major problem with profiling in javascript with anonymous functions, I have

  • 0

I have a major problem with profiling in javascript with anonymous functions, I have always many anonymous functions – most of them are callbacks – and It makes analyzing results of profiler very hard for me.

Finally I decided to use named functions for callbacks, like this:

var f = function(callback) {
    // Do something ...
    callback();
}

f(function named_function() {
    console.log('Sample callback function!');
});

I want to know that will I have any problems after making this change in my codes?
And will this type of function definition and passing reserve the name (named_function) anywhere?

  • 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-10T10:21:18+00:00Added an answer on June 10, 2026 at 10:21 am

    The name will only be available inside the scope of the named function expression.

    But there is a problem in IE 8 and lower. It will leak out to the outer scope, and will actually create a different function object, so you should nullify it if that’s a problem.

    f(function named_function() {
        console.log('Sample callback function!');
    });
    var named_function = null;
    

    See this article for more information: Named function expressions demystified

    Or you could create it like this to solve the IE issue.

    f(function() {
        return function named_function() {
            console.log('Sample callback function!');
        };
    }());
    

    But that’s a little ugly.

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

Sidebar

Related Questions

I have a major problem finding a way to add a space between two
I am having major problem in Data Binding. I have a stackpanel with an
I have a problem, not that major problem but since i implemented sendMultipartTextMessage on
I seem to have a major problem. I opened up Xcode and my main
I have encountered a major problem for myself in the learning process of WPF
I have a major problem getting this to work properly. Here is the deal.
I have a major problem that happened to me. I am writing a program
I used pole display(E POS) in my POS c# application.I have two major problem
I have a major problem with an application im trying to developer atm. I
I have a major problem with project configurations. Everything started when I wanted to

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.