• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

284
Views
How to see the number of function calls and if possible the function names that are in the stack real-time

Is there a way in real-time to see the number of function calls that are in the stack before or regardless of whether the stack size might be exceeded? Could it be shown like this:

console.log("Function: " + funcName + ", nbr of calls in the stack: " + funcCount);
// Function: foo, 22
// Function: bar, 300
// etc...

Functions are called like this:

var mod = function () { 
   var obj = {
        foo: (fn) => "My name is: " + fn, 
        bar: (fn) => "My name is: " + fn
    };
    console.log(((fn) => obj[fn](fn))("foo"));
    console.log(((fn) => obj[fn](fn))("bar"));
}; 
mod();
// My name is: foo
// My name is: bar

So the function when running knows its name since it's passed in.

about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error