Print a trace of the call stack

In javascript you can print the call stack with something like this:

function print_call_stack() {
  var stack = new Error().stack;
  console.log("PRINTING CALL STACK");
  console.log( stack );
}

from: https://stackoverflow.com/questions/4671031/print-function-log-stack-trace-for-entire-program-using-firebug

Tagged with:

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.