title: Get function name in JavaScript
body: <p>Does anyone know if there is a way to get JavaScript function name. For example I got a function like </p>
  
  <pre><code>function test1(){
  alert(1);
  }
  </code></pre>
  
  <p>I have it in my head section. Then I create an object obj1 and put my function there</p>
  
  <pre><code>obj1.func = test1;
  </code></pre>
  
  <p>When I call a method in obj1 object, do I have any way to get my function name (test1) inside of this method, except parsing the source (<code>this.func.toString()</code>) of the function.</p>