let's say I have a function:
function test1() { }
I want to return "test1" from the inside. I found out that you can make arguments.callee
which will return the whole function and then make some ugly regex. Any better way?
what about functions with names?
You can also get your name: for example :.
var test2 = { foo: function() { } };
I want to return foo for this example from the inside.
update: for .callee.name arguments, Chrome returns empty, IE9 returns undefined. and it does not work with scope functions.
source share