While Loop 2


#1



https://www.codecademy.com/courses/javascript-beginner-en-ASGIv/0/2?curriculum_id=506324b3a7dffd00020bf661

Why is this creating an infinite loop?

var understand = true;

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


#2

The result of assignment is the assigned value.

var a;
var b = (a = 5);
console.log(b);  // 5

#3

Actually I figured it out. In the while condition I had reassigned understand with = rather than checking it with ===.


#4

I thought I said that :confused:


#5

You said it confusingly. I read that, figured it out, read it again, replied, read it again, and the finally realized what you meant.