how to get the actual constructor of a javascript object?
<p>is there a way to get the actual called function used to instance the object?</p>

<pre><code>function A(){}
A.prototype.test = function(){};

function B(){}
B.prototype = Object.create(A.prototype);

B.prototype.test = function(){};

var x = new B();
alert(x.constructor);   // alerts "A"
</code></pre>

<p>i'm also interested in cross browser support</p>

<p>thanks</p>
