What's wrong with my code?


#1

var understand = true;

while(understand = true){
console.log("I'm learning while loops!");
understand = false;
}


#2

this does not compare but assigns true to understand. Where the statement understand = true has a value of true and therefore you're trapped in an infinite loop.


#3

Thanks, the code worked.