jQuery logical operators for flow control instead of using if statement
<p>For some reason I can't get the succinct flow control syntax to work with jQuery. The following throws an error:</p>

<pre><code>$(this).hasClass('expanded') &amp;&amp; return
</code></pre>

<p>Whereas this longer version works fine:</p>

<pre><code>if ($(this).hasClass('expanded')) { return}
</code></pre>

<p>Any ideas why the first one is throwing an error?</p>
