What Are the Semantics of Javascripts If Statement
<p>I always thought that an if statement essentially compared it's argument similar to <code>== true</code>.  However the following experiment in Firebug confirmed my worst fears—after writing Javascript for 15 years I still have no clue WTF is going on:</p>

<pre><code>&gt;&gt;&gt; " " == true
false
&gt;&gt;&gt; if(" ") console.log("wtf")
wtf
</code></pre>

<p>My worldview is in shambles here.  I could run some experiments to learn more, but even then I would be losing sleep for fear of browser quirks.  Is this in a spec somewhere?  Is it consistent cross-browser?  Will I ever master javascript?</p>
