title: another javascript function object question - more elegant way then using toString()
body: <p>I turn to you with another Javascript object related question I was not able to find an answer so far.</p>
  
  <p>I understand that functions are objects and that they do not have names. Instead variables are references to those objects.</p>
  
  <pre><code>&gt; var a = function() {
  ... console.log('a');
  ... };
  &gt; a
  [Function]
  &gt; typeof(a)
  'function'
  </code></pre>
  
  <p>All this means that I can not ask a function for its name. I totally agree with that. But there is another case (putting the named function into an array) where I would be interested in the name and it is obviously there. </p>
  
  <pre><code>&gt; var b = [function myname(){console.log('hi');},];
  &gt; b[0]
  [Function: myname]
  &gt; b[0]();
  hi
  &gt; typeof(b);
  'object'
  &gt; typeof(b[0]);
  'function'
  </code></pre>
  
  <p>In the later case I am wondering if  there is a more elegant way of asking for the name ("myname" in this case) then using toString()?</p>
  
  <p>Cheers,
  Mark</p>