开发者

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

This question already has answers here: 开发者_如何学C Closed 11 years ago.

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' );
}


yes.

function something(){
    alert(arguments.callee.name);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜