Possible Duplicate:
How do you find out the caller function in JavaScript?
If I put console.log()
inside a function, is there anything that I can put inside the console.log()
statement to find out where the function was called from? Or is there some other way to find out how a function is called?
I'm trying to understand a relatively complex (complex for someone of my experience) piece of code, and it's hard to figure out what is calling a certain function. Thanks.