What is "x && foo()"?
<p>I saw <a href="http://stackoverflow.com/questions/4340655/difference-between-if-x-foo-and-x-foo-0">somewhere</a> else said,</p>

<p><code>x &amp;&amp; foo();</code></p>

<p>　is equal to</p>

<pre><code>if(x){
    foo();
}
</code></pre>

<p>I tested it and they really did the same thing.<br>
But why? What exactly is <code>x &amp;&amp; foo()</code>?</p>
