Code 1 :
var x = 1;
for( ; x<6 ; x+=2 ){
x=x*x;
}
console.log(x);
In the above code even if the condition is false the part that increments is executed the last time.
Code 2:
var x = 0;
for( ; x<8 ; x++ ){}
console.log(x);
for( ; x>4 ; x-=2 ){}
console.log(x);
In the code above even if the condition is false the part that increments is not executed.
Why is this happening or am I making someone else an error?