1

Possible Duplicate:
Can I get the name of the currently running function in javascript?
Get function name in javascript

Is there any way, in javascript, to obtain the name of the function, inside the function which was called.

function something() {
   console.log( "The name of the function you invoke is " ...should says 'something' );
}
Community
  • 1
  • 1
antonjs
  • 14,060
  • 14
  • 65
  • 91
  • This very same question is answered here: http://stackoverflow.com/questions/1013239/can-i-get-the-name-of-the-currently-running-function-in-javascript – Ivan Nikolchov Sep 06 '11 at 16:40

1 Answers1

0

yes.

function something(){
    alert(arguments.callee.name);
}
galchen
  • 5,252
  • 3
  • 29
  • 43
  • Doesn't work in among others MSIE and it's deprecated: https://developer.mozilla.org/en/JavaScript/Reference/Functions_and_function_scope/arguments/callee – BalusC Sep 06 '11 at 16:42