可能重复:
Can I get the name of the currently running function in javascript?
Get function name in javascript
在javascript中,有没有办法在被调用的函数内获取函数的名称。
function something() {
console.log( "The name of the function you invoke is " ...should says 'something' );
}
答案 0 :(得分:0)
是
function something(){
alert(arguments.callee.name);
}