Get function name from inside itself
<p>let's say I have a function:</p>

<pre><code> function test1() {

       }
</code></pre>

<p>I want to return "test1" from within itself. I found out that you can do <code>arguments.callee</code> which is going to return the whole function and then do some ugly regex. Any better way?</p>

<p>what about namespaced functions? </p>

<p>is it possible to get their name as well:
e.g.:</p>

<pre><code>var test2 = 
{
 foo: function() {
    }
};
</code></pre>

<p>I want to return foo for this example from within itself.</p>

<p><strong>update:</strong> for arguments.callee.name Chrome returns blank, IE9 returns undefined. and it does not work with scoped functions.</p>
