javascript object gets overridden in IE
<p>Geeks,</p>

<p>I have the following codes:</p>

<p>Snippet A:</p>

<pre><code>var x = (function(){ this.id="Dog"; return this; }());
var y = (function(){ this.id="Cat"; return this; }());
alert(x.id); //outputs Cat
alert(y.id); //outputs Cat
</code></pre>

<p>Snippet B:</p>

<pre><code>var x = (new function(){ this.id="Dog"; });
var y = (new function(){ this.id="Cat"; });
alert(x.id); //ouputs Dog
alert(y.id); //outputs Cat
</code></pre>

<p>Why is x replaced by y in Snippet A and not on B?</p>
