Why do the following expanded if shorthand statements not work in javascript?
<p>This is my first attempt to write shorthand if statements however am befuddled by why the expanded versions don't work quite the way I imagined they would.</p>

<p><strong>Code 1</strong> - Does not work</p>

<pre><code>if(document.getElementById == true) {
        alert("The document object model is supported by: " + navigator.appName);   
    }
</code></pre>

<p><strong>Code 2</strong> - Does work</p>

<pre><code>if(document.getElementById != false) {
            alert("The document object model is supported by: " + navigator.appName);   
        }
</code></pre>

<p><strong>Code 3</strong> - The shorthand that does work</p>

<pre><code> if(document.getElementById) {
            alert("The document object model is supported by: " + navigator.appName);   
        }
</code></pre>

<p>Why is that if I expand the shorthand in 3 to the first code sample not work and why does it work if I have it equal to <code>!= false</code>?</p>
