I am executing the following seemingly straightforward code
var number = 0;
while (number <= 12) {
console.log(number);
number = number + 2;
}
and I am getting different results in the browser and in Node. When I run it in the Firebug(v 2.0.4 ) console on Firefox(v. 32.0.3) the result I get is
0 2 4 6 8 10 12 14
which is not`the result I expected.
In Node, the same code gives me the correct answer which is
0 2 4 6 8 10 12
Is there anything I'm missing regarding the behaviour in the browser???
Thanks in advance.
14 0 2 4 6 8 10 12? The 14 seems to be kind of the "result" of the loop (I guess because of the assignment in the loop body). Just like1 + 1prints2. This is in FF 32.0.3. I can't tell yoy why FF is doing that though.14on the end?number = number + 2.