Unexpected behavior testing the results of multiple function calls in an if statement
<p>Let's say I have the following, very simple block of code:</p>

<pre><code>&lt;script&gt;
function hasVal(field) {
    console.log(field);
    var ret = false;

    return ret;
}

if(hasVal('#field1') &amp;&amp; hasVal('#field2')) {
    console.log('here');
}else {
    console.log('there');
}
&lt;/script&gt;
</code></pre>

<p>I was expecting it to output the following:</p>

<pre><code>#field1
#field2
there
</code></pre>

<p>What it actually outputs is:</p>

<pre><code>#field1
there
</code></pre>

<p>Can someone please explain what's going on here? </p>

<p>Does Javascript stop evaluating the rest of the <code>if</code> statement as soon as it gets <code>false</code> back from the first function call?</p>
