function main() { Hello(); } function Hello() { // How do you find out the caller function is \'main\'? }
Is there a way to find out the call
Here, everything but the functionname is stripped from caller.toString(), with RegExp.
functionname
caller.toString()
Show the callers name