If you want to print the javascript call stack you can use:
console.log(newError().stack);
JavaScript
Here it is an example:
functionfirstFunction(){secondFunction();}functionsecondFunction(){thridFunction();}functionthridFunction(){console.log(newError().stack);}firstFunction();//=> Error// at thridFunction (<anonymous>:2:17)// at secondFunction (<anonymous>:5:5)// at firstFunction (<anonymous>:8:5)// at <anonymous>:10:1
Looking for help? At Hashrocket, our
JavaScript experts launch scalable, performant apps on the Web, Android and
iOS. Contact us and find out
how we can help you.