Get name of object or class in javascript
<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 2myClass" as a String
}

function myClass () {
   this.foo = function () {
       alertClassOrObject(this);
   }
}

var myObj = new myClass();
myObj.foo();
</code></pre>

<p>for (var k in this) {...} - there is no information about the className or ObjectName. Is it possible to get one of them ? In PHP its possible - but i did not find any solution in the internet to get it in javascript.</p>
