Why is this an infinite loop? It should run one time



I can't figure out why this While loop is infinitely looping. I can make this code work by changing x-100 to x--. However, I may need to use -100. I tried x - 100; (with spaces) and x-100; (with no spaces). Either way I get an infinite loop.

for (i=0; i<2; i++){
 console.log("This one counts " + i + "times!");   

var x = 1000;
while(x >900){
console.log("WHILE this one counts differently");
x - 100;


x - 100 is a value, nothing more. You need an expression to change value of variable.

x = x - 100;


Ok that makes sense, well kindof. I can see why x=x-100 is more clearly defined, but if we already know what x is, why is it necessary to use x= ?. Just the way it works?




Here a little discussion