Get a JavaScript call stack

May 14th, 2013 by Alex Leave a reply »

Things can get really complicated with JavaScript development, and someone may need to find out a call stack (or, to find a call trace) of current function/line. It’s actually pretty easy with a good modern browser:

console.trace();

That’s it! Running that line in console can give you something like this in Chrome:

(anonymous function)
InjectedScript._evaluateOn
InjectedScript._evaluateAndWrap
InjectedScript.evaluate

Comments are closed.