Bad practice to put = inside javascript if statement?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2576571/javascript-assign-variable-in-if-condition-statement-good-practice-or-not">Javascript : assign variable in if condition statement, good practice or not?</a>  </p>
</blockquote>



<p>Is it bad practice to assign/evaluate things inside an if statement?</p>

<p>eg.</p>

<pre><code>var foo;
var bar = function() { .. }

if(foo = bar()) {
    ..
}
</code></pre>
