Reference and datatype checking, are these the same?
<p>I have a simple function in my library that checks the validity of an object reference (object here meaning, a reference to a created HTML element, mostly DIV's). It looks like this:</p>

<pre><code>function varIsValidRef(aRef) {
    return ( !(aRef == null || aRef == undefined) &amp;&amp; typeof(aRef) == "object");
}
</code></pre>

<p>While experimenting i found that this has the same effect:</p>

<pre><code>function varIsValidRef(aRef) {
    return (aRef) &amp;&amp; typeof(aRef) == "object";
}
</code></pre>

<p>I understand there are some controversies regarding the short hand () test? While testing against various datatypes (null, undefined, integer, float, string, array) i could find no difference in the final outcome. The function seem to work as expected.</p>

<p>Is it safe to say that these two versions does the exact same thing?</p>
