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