How does JavaScript convert types when comparing with == ?
<pre><code>alert (0 == ''); // true
alert (0 == '0'); // true
</code></pre>

<p><a href="http://jsfiddle.net/FuQe5/" rel="nofollow">JSFiddle Proof</a></p>

<p>I understand that == in javascript performs a conversion and then checks for equality, but how does it perform the conversion in the statements above? Does it convert 0 to '' or '' to 0? Or something else perhaps? Is there a spec somewhere that explains the implementation?</p>
