Skip to content

how to find from where a function has been called (function call stack)

I have a function which is being called from several files. Is there a way to determine from which file a function is being invoked by tools like Chrome DevTools?

function turnCoffeIntoCode (args) {
    // logic here

With the above, I can see the arguments being passed to the functions thanks to Chrome’s developer tools but I cannot find from where the function is being called.


You can see the full call stack on the Chrome Developer Tools:

Just add a break point or a debugger; and you will be able to see the call stack and will be able to click and go to different functions in the stack.

And to read more, you can find many questions and answers about the call stack in chrome.