var x = true;
var y = function(){
while(x = true){
console.log(“I win”);
x = false;
}
};
for(var x = 10; x<36; x + 5) {
console.log(x);
};
It is an infinite loop, but I don’t understand how.
var x = true;
var y = function(){
while(x = true){
console.log(“I win”);
x = false;
}
};
for(var x = 10; x<36; x + 5) {
console.log(x);
};
It is an infinite loop, but I don’t understand how.
x+5
doesn’t change the value of x.
x = x+5
is what you want to do.
Thank you that fixed it