title: Get name of object or class
body: <p>Is there any solution to get the function name of an object? </p>
  
  <pre><code>function alertClassOrObject (o) {
     window.alert(o.objectName); //"myObj" OR "myClass" as a String
  }
  
  function myClass () {
     this.foo = function () {
         alertClassOrObject(this);
     }
  }
  
  var myObj = new myClass();
  myObj.foo();
  </code></pre>
  
  <p><code>for (var k in this) {...}</code> - there is no information about the <code>className</code> or <code>ObjectName</code>. Is it possible to get one of them? </p>