Why does this if-statement based on short-circuited evaluation not work?
<p>In the <code>fun</code> function, I want to return 1 if the boolean expression is true.</p>

<pre><code>function fun() {
    (1 == 1) &amp;&amp; return 1;
}

alert(fun());
</code></pre>

<p>​Of course, I can easily do this with <code>if (1 == 1) return 1</code>. However, I am wondering why the above code does not work. It triggers a "Uncaught SyntaxError: Unexpected token return" error in the console in Chrome.</p>

<p>Shouldn't <code>return 1</code> only run if <code>(1 == 1)</code> is true? Why does this not work?</p>
