Confused about while loop in javascript
<p>I might be being a bit thicky here but please answer me this.  Consider the following code:</p>

<pre><code>a=1;
while(a&lt;=6) {
   console.log(a);
   a++;
}
</code></pre>

<p>If I run this I get values in the console from 1 to 6, and then another 6.</p>

<p>Now look at this:</p>

<pre><code>a=1;
while(a&lt;=6) {
    console.log(a);
    ++a;
}
</code></pre>

<p>Running this will now get me the values from 1 to 7.</p>

<p>Why is this happening?  My understanding was that the statement block would only run if the expression evaluates to true.  How can this be possible in the second of my examples?  And why does 6 appear twice in the first?  Very confusing for me.</p>

<p>If you can explain simply (I'm still learning) that would be great.</p>
