title: declaration for variable in while condition in javascript
body: <p>In essence, I am trying to declare a variable in the condition-part of a while loop in javascript:</p>
  
  <pre><code>while (var b=a.pop()) {
    do_sth(b)
  }
  </code></pre>
  
  <p>Yet, my browser (firefox) doesn't accept that. Instead I have to go like so:</p>
  
  <pre><code>var b
  while (b=a.pop()) {
    do_sth(b)
  }
  </code></pre>
  
  <p>which works. Is this behaviour expected?</p>