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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:19:35+00:00 2026-05-31T17:19:35+00:00

Very often, I find myself using a callback function and I don’t have its

  • 0

Very often, I find myself using a callback function and I don’t have its documentation handy, and it would be nice to see all of the arguments that are meant to be passed to that callback function.

// callback is a function that I don't know the args for...
// and lets say it was defined to be used like: callback(name, number, value)
something.doSomething( callback );

How can I determine what args its passing into that?

Note: looking at the source code can be unhelpful when the code itself is obfuscated and minified (as many js frameworks are)

  • 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-31T17:19:36+00:00Added an answer on May 31, 2026 at 5:19 pm

    To get the list of arguments without breaking functionality, overwrite the callback function in this way:

    var original = callback;
    callback = function() {
        // Do something with arguments:
        console.log(arguments);
        return original.apply(this, arguments);
    };
    
    1. The context, this is preserved.
    2. All arguments are correctly passed.
    3. The return value is correctly passed.

    NOTE: This method works in most cases. Though there are edge cases where this method will fail, including:

    • Read-only properties (e.g. defined using Object.defineProperty with writable:false)
    • Properties that are defined using getters/setters, when the getter/setter is not symmetric.
    • Host objects and plugin APIs: E.g. Flash and ActiveX.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I find myself trying to convert constructor parameters to their right types very often
This is a very simple question. I often find myself wanting to create a
I often find myself using lambdas as some sort of local functions to make
I often find myself in need of very complex SQL examples when testing abstraction
I find myself very often creating an object that has no public methods and
I find myself very often in the situation that I open an element in
I am not a very orderly person at times and I often find myself
The history of my repository is very complex. I often find myself wanting to
I often find myself writing very similar code across projects. And more often than
I often find myself writing very simple classes instead of C-style structs. They typically

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.